|
|
|
No.
Server.MapPath will only go to the root of the web application. Technically, everything for that application should be under the root folder for the web app.
IIS goes out of its way to prevent you from going outside your web application root for security reasons.
|
|
|
|
|
I hope this is the right category where should I post this, if not, I'm sorry but I really need a solution to this cause I don't know how should I suppose to do it.
So, I have a setup file for a C# application. I want to write it on a cd and to run automatically the executable when disk is inserted in pc. So far, so good. But, I want that the cd to be able to run it only on one pc. How can I do that?
This is a general question cause I don't have any idea about from where to start for achieving this goal. Any answer is welcomed, thanks!
|
|
|
|
|
DPaul1994 wrote: I want that the cd to be able to run it only on one pc. Do you mean by that you want it to run only on one specific PC or it shouldn't be able to run on another PC if it has already run on any PC?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
You cannot prevent the setup from being run on multiple PC's. There's simply no reliable way your code can know if it was installed on anther machine already.
|
|
|
|
|
If you really want to limit it to a single installation, you will need to produce a different CD for each PC, which contains a identification code which is part of the resulting app. With an internet connection, you can check if the installation from the CD has already been done and reject it, and check the app is "still allowed" every time it runs as well.
But...it's a PITA, both from a logistical POV to produce the disks and from a user POV since these things tend to go wrong at the worst moments.
Generally speaking, unless this is a mass market application you will probably spend more protecting your app than you would have lost in actual piracy. And even for the big boys it doesn't always work - look at how fast "cracked" versions of Photoshop appear on torrent site after a new release. Same day sometimes: and Adobe spend a lot of money of copy protection...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I see. Thank you for your answer, it helps!
|
|
|
|
|
Hello
I'm a student and currently working as an intern on my own to build a small software using WPF. Just a bit of context: The program needs to receive user inputs to schedule upcoming task. I wanted people opinion on how to store those tasks in WPF (likely externaly) in a way that makes it easy to modify / delete said tasks.
Obviously I'm thinking a plain text file with separator(unless someone has a better idea), but how exactly would I proceed? The twist is that the tasks can be called several times each week, but always at the same hour.
So when a user enter a task to repeat itself monday and friday every week, should I create two entries on my file (Monday and Friday) or only one that could look like "Task04;Mo,Fr;..."?
First time posting btw, I'd like to thank the community for all the ressources at our disposal that really helped me
|
|
|
|
|
I would recommending using a database and SQL; something like SQLite would be nice, clean and simple. That way you don't have to worry about how you keep your data consistent, there's provisions in the database for that.
Working with text-files is complicated for larger datasets. Having the data in a well-known format would allow you to look at/manipulate the data with an existing tool (which in turn is usefull if you are hunting down a bug)
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for your answer.
I already considered it, but wouldn't that require a local SQL server? And if so, is it possible to include it in the installation already configured? Because if that's the case that would avoid many compromises in my design ^^.
Then again I guess it's fine if I have to install and configure it manually, would still be better if I don't have to though
EDIT: It seems SQLite doesn't require a server (unless I'm wrong) so I'll go with that! Thank you for your help
modified 3-Jul-15 9:31am.
|
|
|
|
|
Member 11718830 wrote: I already considered it, but wouldn't that require a local SQL server? No, SQLite doesn't; I'd recommend Sql Server if you have a team working on a set of data, or if it would be used for reporting a lot. Since you talked about a file, I assumed a local file-based database format would be more appropriate.
Member 11718830 wrote: And if so, is it possible to include it in the installation already configured? Yup. That goes for Sql Server as well as SQLite.
Member 11718830 wrote: Then again I guess it's fine if I have to install and configure it manually,
would still be better if I don't have to though Hehe, YOU will have to; but your users will not have to. You'd still need to explain to the setup procedure how to install the thing, and with wich options.
For SQLite that is rather simple - it's just two libraries extra to copy to the applications' directory.
Alternatively, you could look into XML; it would be a structured way to keep data in a text-based-file.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I'll look into it, thank you!
|
|
|
|
|
You're welcome
|
|
|
|
|
Window 8.1 Universal app- How we create a Grid app?
|
|
|
|
|
|
I am asking about Windows 8.1 universal app.
For universal app grid app project type is not available.
|
|
|
|
|
hi all!
can someone explain to me the difference between the two equations:
1)v = (u(M1-M2)+(2M2*u))/(M1+M2) (elastic collisions)
2)v= vA + j/MA*n (impulse method)
In physics, are they the same?
thanks!
|
|
|
|
|
Isawyouoo wrote: In physics, are they the same? Ask a physics grad. These forums are for programming issues.
|
|
|
|
|
Equations may look like code, but in practice they are very different.
You need to ask a physicist, not a developer.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hi,
I have a string that may contains several hashtags starting with # like this example:
"Hello, I am #Hashtag1 and #Hashtag2"
I want to save those hashtags, as many as they are, in an array.
Can anyone help me how to do it.
Thank you in advance.
|
|
|
|
|
Use a regex to identify them:
\#\w*
You can then use the Regex.Matches to convert them to a collection with Linq methods:
string[] hashtags = Regex.Matches(myDate, @"\#\w*").Cast<Match>().Select(m => m.Value).ToArray();
[edit]Matches, not Match, Griff [/edit]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
modified 2-Jul-15 15:20pm.
|
|
|
|
|
That should be Regex.Matches , not Regex.Match .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Clearly, I read what I meant to type...
Thanks!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
thank you so much, it worked perfectly
|
|
|
|