{"id":227,"date":"2016-12-27T14:07:06","date_gmt":"2016-12-27T14:07:06","guid":{"rendered":"https:\/\/ibex.tech\/csharp\/?p=227"},"modified":"2022-02-17T06:24:14","modified_gmt":"2022-02-17T06:24:14","slug":"special-directories","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/c-sharp\/file-input-and-output\/special-directories","title":{"rendered":"Special Directories"},"content":{"rendered":"<h4>\n\tLocation To Store Application Data<br \/>\n<\/h4>\n<pre>\r\n<code>\r\nprivate const string MY_FILE_DIRECTORY_TO_USE\t\tEnvironment::GetFolderPath(Environment::SpecialFolder::ApplicationData) + &quot;\\\\&quot; + Application::CompanyName + &quot;\\\\&quot; + Application::ProductName + &quot;\\\\&quot;\r\n<\/code><\/pre>\n<p>\n\tWindows 7 path from using the above:\n<\/p>\n<p style=\"margin-left: 40px;\">\n\tC:\\Users\\MyUserName\\AppData\\Roaming\\Company Name\\App Name\n<\/p>\n<p>\n\tN.B.&nbsp;SpecialFolder::CommonApplicationData is not the same as&nbsp;ApplicationData. &nbsp;Non-Admin users and applications running as a non admin user do not have permission to write to the CommonApplicationData folder, because that folder does not belong to specific users. &nbsp;If your application uses&nbsp;CommonApplicationData you will find that it is unable to write to it under Windows 8 and possbily Windows 7. Use&nbsp;ApplicationData instead.\n<\/p>\n<p>\n\t&nbsp;\n<\/p>\n<p>\n\t&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Location To Store Application Data private const string MY_FILE_DIRECTORY_TO_USE Environment::GetFolderPath(Environment::SpecialFolder::ApplicationData) + &quot;\\\\&quot; + Application::CompanyName + &quot;\\\\&quot; + Application::ProductName + &quot;\\\\&quot; Windows 7 path from using the above: C:\\Users\\MyUserName\\AppData\\Roaming\\Company Name\\App Name N.B.&nbsp;SpecialFolder::CommonApplicationData is not the same as&nbsp;ApplicationData. &nbsp;Non-Admin users and applications running as a non admin user do not have permission to write to the CommonApplicationData [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-file-input-and-output"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=227"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":229,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/227\/revisions\/229"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}