windows - GetEnvironmentVariable("CSIDL_COMMON_APPDATA") returns null -



windows - GetEnvironmentVariable("CSIDL_COMMON_APPDATA") returns null -

i'm trying environmentvariable "csidl_common_appdata" using below statement

system.environment.getenvironmentvariable("csidl_common_appdata");

i expected "c:\programdata\" back. null i'm running c# programme on windows 7 32 bit machine. please help.

you one thousand miles away doing correctly. not environment variable, constant pass shgetfolderpath() winapi function. write kind of code in native language. in c#, utilize environment.getfolderpath() instead:

string path = environment.getfolderpath(environment.specialfolder.commonapplicationdata); console.writeline(path);

output:

c:\programdata

windows c#-4.0 windows-7

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -