special-folders

C# difference between Environment.SpecialFolders and Application folders

拥有回忆 提交于 2020-01-01 19:08:40
问题 What is the difference between the magic paths in these namespaces: Environment.SpecialFolder.LocalApplicationData versus Application.LocalUserAppDataPath And Environment.SpecialFolder.ApplicationData versus Application.CommonAppDataPath etc... 回答1: They are not the same. The Application version of them is aware of ClickOnce deployment, adjusting the paths accordingly to keep them isolated. 回答2: On Windows 7: Environment.SpecialFolder.LocalApplicationData = C:\Users\username\AppData\Local

C# difference between Environment.SpecialFolders and Application folders

旧城冷巷雨未停 提交于 2020-01-01 19:07:15
问题 What is the difference between the magic paths in these namespaces: Environment.SpecialFolder.LocalApplicationData versus Application.LocalUserAppDataPath And Environment.SpecialFolder.ApplicationData versus Application.CommonAppDataPath etc... 回答1: They are not the same. The Application version of them is aware of ClickOnce deployment, adjusting the paths accordingly to keep them isolated. 回答2: On Windows 7: Environment.SpecialFolder.LocalApplicationData = C:\Users\username\AppData\Local

Finding a Windows user's “true” application data folder?

筅森魡賤 提交于 2020-01-01 04:47:11
问题 I have a Delphi 6 application that, like most Windows applications, reads/writes data to the user's "local application data" folder. I use the code below to determine that folder. Up until now, that code worked for most of my users. I have encountered a user whose local application data is not in the expected folder: C:\Users\Bob\AppData\Roaming\ Usually the local app data folder resolves to: C:\Documents and Settings\Bob\Application Data\ What is odd about this user's particular situation is

Special Folder “Common Application Data Folder” not available in my setup project. Why?

假装没事ソ 提交于 2019-12-30 08:33:18
问题 I want to create a Visual Studio 2010 setup project that deploys some files to a folder where my application can use it from. I want it so, that all users have the same files, and that they also could manipulate them without admin rights. Thus, "Common Application Data Folder"* as described in this MSDN article, seems fine. However, in my Visual Studio 2010 setup project I did not find the "Common Application Data Folder" available in the "Add special Folder..." drop down menu. I have a .NET

Expand environment variable for My Documents

无人久伴 提交于 2019-12-30 06:00:13
问题 I know I can read environment variables like this: Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); However, it would be really helpful to me if I could do something like this: Environment.ExpandEnvironmentVariables(@"%MyDocuments%\Foo"); Is there an environement variable that equals SpecialFolder.MyDocuments? I also tried to do something like this, but this doesn't lead to the expected result: Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\My Documents\Foo"); This

Expand environment variable for My Documents

大兔子大兔子 提交于 2019-12-30 05:59:09
问题 I know I can read environment variables like this: Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); However, it would be really helpful to me if I could do something like this: Environment.ExpandEnvironmentVariables(@"%MyDocuments%\Foo"); Is there an environement variable that equals SpecialFolder.MyDocuments? I also tried to do something like this, but this doesn't lead to the expected result: Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\My Documents\Foo"); This

how to find MyMusic Folder from other users?

故事扮演 提交于 2019-12-29 08:17:18
问题 how to find MyMusic Folder of other users ? 回答1: If the account you are running the program on has administrative privlieges, can't you just navigate to c:\Users\<UserName>\Music (which is the path on Windows7). If you're looking for folders of users on another machine, then that is more difficult. EDIT: It appears that there is a way to do this, from MSDN: HRESULT SHGetKnownFolderPath( __in REFKNOWNFOLDERID rfid, __in DWORD dwFlags, __in HANDLE hToken, __out PWSTR *ppszPath ); With the rfid

Get special folder localized name in OS X

限于喜欢 提交于 2019-12-25 03:14:19
问题 I am writing a script that copies some files to ~/Library/Application Support/... directory. This script will fail on a non english mac because Library/Application Support may be called in a different name. How can I get a localized special folder name in bash? Yosemite 10.10.2 回答1: OS X does not localize the names of files or folders on disk. It only localizes them in the GUI. /Applications is always /Applications on disk or when accessed at the BSD/POSIX API layer. In German, that folder

How can .NET TraceListener be configured to log to TEMP folder

◇◆丶佛笑我妖孽 提交于 2019-12-23 18:33:49
问题 How can .NET TraceListener be configured to log to TEMP folder? Is it possible to do this in app.config like: <add type="System.Diagnostics.TextWriterTraceListener" initializeData="%Temp%\logfilename.log"/> .. without making any code changes? Or can this only be done if you create your listener in code? 回答1: You'd have to set it in your code. As you can see in the source code, the constructor immediately assigns to file name with no parsing of the internal structure of the file name. public