views:

151

answers:

1

Hi, I need do some quick and dirty logging and I was asked to write to a file.

I have done all the logging and now I need to save it somewhere on this Win Server 2008 Operating system.

Does anybody know what the output is in Win Server 2008 for the following line of code. string myPath=Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);

Thanks a lot.

A: 

Most likely it is

%systemdrive%\ProgramData

...which is probably

C:\ProgramData

unless Windows 2008 was installed on a drive other than C: (uncommon). Part of the reason Environment.SpecialFolder exists is so we don't have to think about these things.

http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

Robert Harvey
I just tested and I confirm that it is `C:\ProgramData`
Pierre-Alain Vigeant