application-data

Where to save application data in .NET application

坚强是说给别人听的谎言 提交于 2020-02-21 11:13:23
问题 My application is something similar to a Contact Manager. Let's say a user can enter contacts with their addresses. I have the code and technology to save my contacts to a file. But where do I save that file? Considering this is a .NET application running on Windows. Should my file end up in the AppData of the users folder? Should I use the Isolated Storage (as mentioned here)? Something else? What's the recommended practice? 回答1: I ended up using the solution Patrick suggested: Environment

ApplicationData using in Console with UWP parameters

左心房为你撑大大i 提交于 2020-01-23 03:46:06
问题 I'm trying to follow UWP with Desktop Extension – Part 2 of UWP and WinForms desktop-bridge calling the processes and passing parameters. This example Console Program.cs code includes parameters string: string parameters = ApplicationData.Current.LocalSettings.Values["parameters"] as string; But the name ApplicationData does not exists in the current context, I'm trying to find out, if I've missed some reference or it is different version of C# I'm not sure even if it is what it requires, but

Is there a way to keep files in App_Data from overwriting newer files when publishing?

一笑奈何 提交于 2019-12-11 00:24:50
问题 I use an XML file in App_Data in conjunction with a Repeater on the main page of an intranet application allow me to display messages to users when they logon about application status, maintenance, etc. To test the functionality, it would be nice to have the file in the App_Data folder under development, but if I do this it copies it over the file on the production server when I publish the application. Is there anyway I can prevent this from happening short of going to a Web Deployment

Where to put common writable application files?

梦想与她 提交于 2019-11-28 06:55:09
I thought that CSIDL_COMMON_APPDATA\company\product should be the place to put files that are common for all users of the application and that the application can modify, however, on Vista this is a read-only location, unless modified by the installer (as per MSDN - http://msdn.microsoft.com/en-us/library/ms995853.aspx ), so... what's best? Modify the location's security settings to allow writing or use CSIDL_COMMON_DOCUMENTS\company\product instead? Maybe there's a third option? Also, is there an "official" Microsoft recommendation on this somewhere? Modify just the security on a specific sub

How do I get the application data path in Windows using C++?

半世苍凉 提交于 2019-11-27 08:01:28
I looked all over the internet and there doesn't seem to be a decent solution that I could find. I want to be able to programmatically in C++ obtain the path "%ALLUSERSPROFILE%\Application Data" that explorer can translate into a real path. Can I do this without relying on third-party code? Use SHGetFolderPath with CSIDL_COMMON_APPDATA as the CSIDL. TCHAR szPath[MAX_PATH]; if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, szPath))) { //.... } Danield Just to suppliment interjay's answer I had to include shlobj.h to use SHGetFolderPath . Often you may need to read a file from

How do I find the Windows common application data folder using Python?

ⅰ亾dé卋堺 提交于 2019-11-27 04:12:59
I would like my application to store some data for access by all users. Using Python, how can I find where the data should go? If you don't want to add a dependency for a third-party module like winpaths, I would recommend using the environment variables already available in Windows: What environment variables are available in Windows? Specifically you probably want ALLUSERSPROFILE to get the location of the common user profile folder, which is where the Application Data directory resides. e.g.: C:\> python -c "import os; print os.environ['ALLUSERSPROFILE']" C:\Documents and Settings\All Users

Where to put common writable application files?

只愿长相守 提交于 2019-11-27 01:36:18
问题 I thought that CSIDL_COMMON_APPDATA\company\product should be the place to put files that are common for all users of the application and that the application can modify, however, on Vista this is a read-only location, unless modified by the installer (as per MSDN - http://msdn.microsoft.com/en-us/library/ms995853.aspx), so... what's best? Modify the location's security settings to allow writing or use CSIDL_COMMON_DOCUMENTS\company\product instead? Maybe there's a third option? Also, is

SHGetFolderPath() for a specific user

浪尽此生 提交于 2019-11-26 21:57:38
问题 I'm looking for a good way to get the local application data folder for a specific user -- without having to enter the login details for that user. SHGetFolderPath() can accept an access token for whatever user I want to get the local appdata folder for, but to get an access token, you have to provide the user's password. Also, according to the docs this isn't supported on <= Windows 2000. The registry key HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folder contains the

How do I get the application data path in Windows using C++?

一个人想着一个人 提交于 2019-11-26 13:57:24
问题 I looked all over the internet and there doesn't seem to be a decent solution that I could find. I want to be able to programmatically in C++ obtain the path "%ALLUSERSPROFILE%\Application Data" that explorer can translate into a real path. Can I do this without relying on third-party code? 回答1: Use SHGetFolderPath with CSIDL_COMMON_APPDATA as the CSIDL. TCHAR szPath[MAX_PATH]; if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, szPath))) { //.... } 回答2: Just to suppliment

How do I find the Windows common application data folder using Python?

泄露秘密 提交于 2019-11-26 12:43:01
问题 I would like my application to store some data for access by all users. Using Python, how can I find where the data should go? 回答1: If you don't want to add a dependency for a third-party module like winpaths, I would recommend using the environment variables already available in Windows: What environment variables are available in Windows? Specifically you probably want ALLUSERSPROFILE to get the location of the common user profile folder, which is where the Application Data directory