Click here to Skip to main content
15,909,829 members
Home / Discussions / C#
   

C#

 
GeneralRe: referencing from C: or D: drive Pin
Not Active31-May-07 5:21
mentorNot Active31-May-07 5:21 
GeneralRe: referencing from C: or D: drive Pin
kubben31-May-07 5:31
kubben31-May-07 5:31 
GeneralRe: referencing from C: or D: drive Pin
snorkie31-May-07 8:28
professionalsnorkie31-May-07 8:28 
GeneralRe: referencing from C: or D: drive Pin
Dave Kreskowiak31-May-07 8:41
mveDave Kreskowiak31-May-07 8:41 
GeneralRe: referencing from C: or D: drive Pin
snorkie31-May-07 9:01
professionalsnorkie31-May-07 9:01 
AnswerRe: referencing from C: or D: drive Pin
Not Active31-May-07 5:20
mentorNot Active31-May-07 5:20 
AnswerRe: referencing from C: or D: drive Pin
Dave Kreskowiak31-May-07 5:56
mveDave Kreskowiak31-May-07 5:56 
AnswerRe: referencing from C: or D: drive Pin
Luc Pattyn31-May-07 9:56
sitebuilderLuc Pattyn31-May-07 9:56 
Hi,

I am a bit surprised by the answers so far.

For starters you cant hard code C: or D: or whatever.
C: does not even have to exist; I have seen systems that boot and run from D:

Second, you cant use CurrentDirectory, as Dave pointed out.
You can not even use it if you store its startup value,
since one may start an app with its CD preset to whatever value one chooses
(try creating a desktop link, and watch its properties).

third, wherever the app (the exe file) is located, you are not guaranteed that
you can write to that folder. Unless your normal use is only reading that file,
you should choose another place.

The easy way out is by using the special folders, as can be found in
the Environment.SpecialFolder enumeration; you will find some that are
user-independent, others are user-specific.

So I suggest reading up on that class.

Smile | :)


QuestionDrawToolsRedux, but in OpenGl Pin
a_david12331-May-07 2:49
a_david12331-May-07 2:49 
QuestionUsing GetMessage in C# Pin
gapfulgence31-May-07 2:46
gapfulgence31-May-07 2:46 
AnswerRe: Using GetMessage in C# Pin
kubben31-May-07 3:00
kubben31-May-07 3:00 
GeneralRe: Using GetMessage in C# Pin
gapfulgence31-May-07 4:19
gapfulgence31-May-07 4:19 
GeneralRe: Using GetMessage in C# Pin
kubben31-May-07 4:22
kubben31-May-07 4:22 
GeneralRe: Using GetMessage in C# Pin
gapfulgence31-May-07 6:11
gapfulgence31-May-07 6:11 
GeneralRe: Using GetMessage in C# Pin
baranils4-Jan-11 9:00
baranils4-Jan-11 9:00 
GeneralRe: Using GetMessage in C# Pin
kubben4-Jan-11 13:12
kubben4-Jan-11 13:12 
GeneralRe: Using GetMessage in C# Pin
baranils4-Jan-11 19:41
baranils4-Jan-11 19:41 
GeneralRe: Using GetMessage in C# Pin
kubben5-Jan-11 1:56
kubben5-Jan-11 1:56 
GeneralRe: Using GetMessage in C# Pin
baranils5-Jan-11 2:23
baranils5-Jan-11 2:23 
GeneralRe: Using GetMessage in C# Pin
kubben5-Jan-11 2:42
kubben5-Jan-11 2:42 
GeneralRe: Using GetMessage in C# Pin
baranils5-Jan-11 3:44
baranils5-Jan-11 3:44 
Questionautogenerated delete button Pin
tauras8131-May-07 2:32
tauras8131-May-07 2:32 
AnswerRe: autogenerated delete button Pin
kubben31-May-07 3:08
kubben31-May-07 3:08 
AnswerRe: autogenerated delete button Pin
Manoj Kumar Rai31-May-07 4:59
professionalManoj Kumar Rai31-May-07 4:59 
Questionautomated delete button in grid view Pin
tauras8131-May-07 2:31
tauras8131-May-07 2:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.