收录日期:2020/05/27 11:51:04 时间:2009-08-07 16:12:44 标签:vb.net,winforms

in vb.net i am trying to save application settings but for USER but i cannot find the user.config file

when does this file get created?

i searched my entire hardrive. i also searched the entire project.

You don't need to know where it is (and it's different under XP and Vista)

All you need to do is

Settings.Default.Save();

The user.config file is typically stored in their profile directory under the following structure:

Profile Directory\Company Name\App Name_Evidence Type_Evidence Hash\Version\user.config

Have you checked there?

EDIT: Taken from the article to help cover ambiguity about the path descriptions:

Profile Directory - is either the roaming profile directory or the local one. Settings are stored by default in the local user.config file. To store a setting in the roaming user.config file, you need to mark the setting with the SettingsManageabilityAttribute with SettingsManageability set to Roaming.

Company Name - is typically the string specified by the AssemblyCompanyAttribute (with the caveat that the string is escaped and truncated as necessary, and if not specified on the assembly, we have a fallback procedure).

App Name - is typically the string specified by the AssemblyProductAttribute (same caveats as for company name).

Evidence Type and Evidence Hash - information derived from the app domain evidence to provide proper app domain and assembly isolation.

Version - typically the version specified in the AssemblyVersionAttribute. This is required to isolate different versions of the app deployed side by side.