Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use the <a href="http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx" rel="nofollow noreferrer"><code>Environment.GetFolderPath</code></a> to get the most appropriate folder in an OS-independent manner.</p> <p>In particular, you need one of the following SpecialFolder values:</p> <ul> <li><strong><code>ApplicationData</code></strong> - if the files are roaming, per-user and are for the application use only and don't represent documents the user might care about.</li> <li><strong><code>LocalApplicationData</code></strong> - if the files are non-roaming, per-user and are for the application use only and don't represent documents the user might care about.</li> <li><strong><code>CommonApplicationData</code></strong> - if the files are roaming, common for all user and are for the application use only and don't represent documents the user might care about. <strong>NOTE:</strong> On Vista this maps to <strong><code>C:\ProgramData</code></strong>, which is by default read-only for regular users (due to the fact that changing files in there might affect behavior of programs used by admins). You can either explicitly change the permissions on your app subfolder, or choose one of the other options.</li> <li><strong><code>MyDocuments</code></strong> - if the files are per-user and represent documents.</li> </ul> <p>Note that there's no <code>SpecialFolder</code> enum value like <strong><code>CommonDocuments</code></strong> that would represent machine-wide document store, even though there is a folder intended to serve like one (<strong><code>C:\Documents and Settings\All Users\Documents</code></strong> on XP and <strong><code>C:\Users\Public\Documents</code></strong> on Vista). You will have to find the OS version yourself and choose the appropriate folder if you want to write to these locations.</p> <p>Internally <code>Environment.GetFolderPath</code> uses the Win32 API <a href="http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx" rel="nofollow noreferrer"><code>SHGetFolderPath</code></a>. The enumeration used by <code>SHGetFolderPath</code> gives you the well-known locations for several other special folders (including Common Documents). You might use directly <code>SHGetFolderPath</code>; you can find it's <a href="http://www.pinvoke.net/default.aspx/shell32/SHGetFolderPath.html" rel="nofollow noreferrer">p/invoke definition</a> and the corresponding <a href="http://www.pinvoke.net/default.aspx/shell32/CSIDL.html" rel="nofollow noreferrer">CSIDL enum definition</a> on PInvoke.net.</p> <p>You can also use the <a href="http://msdn.microsoft.com/en-us/library/3ak841sy.aspx" rel="nofollow noreferrer"><code>IsolatedStorage</code></a>. However, it is non-roamable, per-user, with limited quota and is not easily accessible to the user from Windows Explorer. As such, it is really a medium/low-trust equivalent to <code>SpecialFolder.ApplicationData</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload