special-folders

How to use Application Data in an (App.config) connectionString

穿精又带淫゛_ 提交于 2019-11-28 11:33:37
I've got an SQL Server CE database in a project that I wan't to store somewhere in the %AppData% directory. However I can't find a way to make a reference to the Application Data path in the connection string (in the App.Config) <?xml version="1.0"?> <configuration> <configSections> </configSections> <connectionStrings> <add name="EntityConnectionString" connectionString="metadata=res://*/EntityModel.csdl|res://*/EntityModel.ssdl|res://*/EntityModel.msl;provider=System.Data.SqlServerCe.3.5;provider connection string="Data Source=|ApplicationData|\Entities.sdf"" providerName="System.Data

Where to store Application Data in Windows 7 and Vista

自作多情 提交于 2019-11-28 11:04:48
My application needs to, like most, store data. The application was previously used on XP only where it would store the data in Program Files . Now that our customers are moving to Windows 7 I had to upgrade it so that it stored the data in a new folder. I opted for the ApplicationData folder as I thought I would be allowed access without needing UAC at all. Now on some Windows 7 machines this is fine, but on others access to the folder fails, presumably because of permissions, but when ran with Administrator privelidges the program works fine. Am I using the wrong folder or are these cases

python - Finding the user's “Downloads” folder

雨燕双飞 提交于 2019-11-28 09:53:48
I already found this question that suggests to use os.path.expanduser(path) to get the user's home directory. I would like to achieve the same with the "Downloads" folder. I know that this is possible in C# , yet I'm new to Python and don't know if this is possible here too, preferable platform-independent (Windows, Ubuntu). I know that I just could do download_folder = os.path.expanduser("~")+"/Downloads/" , yet (at least in Windows) it is possible to change the Default download folder . user4815162342 Correctly locating Windows folders is somewhat of a chore in Python. According to answers

CommonAppData in vb6

北战南征 提交于 2019-11-28 09:29:17
Basically the same as this question , but for VB6 . A customer's application "AppName" has its configuration files stored in CommonAppData. Under Windows XP that is C:\Documents and Settings\All Users\Application Data\AppName Under Windows Vista that is C:\ProgramData\AppName How do I get the correct foldername with VB6? ? Additional notes , I prefer to use a API Call instead of adding a reference to the shell32.dll Use late binding: Const ssfCOMMONAPPDATA = &H23 Dim strCommonAppData As String strCommonAppData = _ CreateObject("Shell.Application").NameSpace(ssfCOMMONAPPDATA).Self.Path found it

Find system folder locations in Python

本小妞迷上赌 提交于 2019-11-28 08:38:34
I am trying to find out the location of system folders with Python 3.1. For example "My Documents" = "C:\Documents and Settings\User\My Documents", "Program Files" = "C:\Program Files" etc etc. I found a slightly different way of doing it . This way will give you the location of various system folders and uses real words instead of CLSIDs. import win32com.client objShell = win32com.client.Dispatch("WScript.Shell") allUserDocs = objShell.SpecialFolders("AllUsersDesktop") print allUserDocs Other available folders: AllUsersDesktop, AllUsersStartMenu, AllUsersPrograms, AllUsersStartup, Desktop,

Writing to internal SD card on Android

心不动则不痛 提交于 2019-11-28 08:31:23
问题 Is there any way of accessing the internal SD card on Android devices that have internal flash, internal SD and external SD cards? 回答1: In Android 2.2 and previous, there is only one "external storage" ( Environment.getExternalStorageDirectory() ). The definition of where this points is up to the device manufacturer. The Compatibility Definition Document (CDD) merely mandates that it be at least 2GB, IIRC. It is not even required for "external storage" to be removable. At this time, there are

What determines the return value of Path.GetTempPath()?

☆樱花仙子☆ 提交于 2019-11-28 07:07:24
Currently, I use Path.GetTempPath() to figure out where to write my log files, but recently I came across a user's machine where the path returned was not what I expected. Usually, the returned path is C:\Documents and Settings\[userid]\Local Settings\Temp but in this case, it was C:\Temp This would not normally be a problem, but for some reason the user in question did not have access to write to C:\Temp I double checked the environment variables, and the USER environment variable was pointing as expected to C:\Documents and Settings\[userid]\Local Settings\Temp , whilst the SYSTEM

What's the difference between SpecialFolder.Desktop and SpecialFolder.DesktopDirectory?

三世轮回 提交于 2019-11-27 19:59:30
I'm confused about the differences between these two special folders. Here's a code snippet that writes the output of each, but they output the same thing. string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string pathTwo = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); Console.WriteLine(path); Console.WriteLine(pathTwo); Console.ReadKey(); According to the MSDN documentation ( for .NET 1.1 ): Desktop The logical Desktop rather than the physical file system location. DesktopDirectory The directory used to physically store file objects on the

As a developer, how should I use the special folders in Windows Vista (and Windows 7)?

冷暖自知 提交于 2019-11-27 19:22:06
Where should I save data related to my application? Where should I save configuration files? Where should I save temporary files? Should I do it in "Documents"? "AppData"? Etc... What is the best practice for saving data to the disk (I guess, best practice for special folders?!)? Foxfire ApplicationData : Everything that your application needs as "per user" data and does not fall under other categories. Standard configuration files would go here. CommonApplicationData : Everything that is not "per user" data. LocalApplicationData : Data that is per user and non-roaming. For example, everything

How to use Application Data in an (App.config) connectionString

核能气质少年 提交于 2019-11-27 06:24:21
问题 I've got an SQL Server CE database in a project that I wan't to store somewhere in the %AppData% directory. However I can't find a way to make a reference to the Application Data path in the connection string (in the App.Config) <?xml version="1.0"?> <configuration> <configSections> </configSections> <connectionStrings> <add name="EntityConnectionString" connectionString="metadata=res://*/EntityModel.csdl|res://*/EntityModel.ssdl|res://*/EntityModel.msl;provider=System.Data.SqlServerCe.3.5