首页 > 代码库 > 知其然知其所以然--Properties.Settings.Default.Save();

知其然知其所以然--Properties.Settings.Default.Save();

winform提供自带的配置,最近查看了一下,数据到底保存到什么地方去了

主目录在这下面C:\Users\Administrator\AppData\                 使用的是win7的系统

C:\Users\Administrator\AppData\Local\程序的名字\BmpProject.exe_Url_2zmdfmzmrtwjomeciqta4ch2sieyx4id\1.0.0.0\user

最后一个user是一个xml config类型的 文件

<?xml version="1.0" encoding="utf-8"?><configuration>    <configSections>        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >            <section name="BmpProject.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />        </sectionGroup>    </configSections>    <userSettings>        <BmpProject.Properties.Settings>            <setting name="serialportName" serializeAs="String">                <value>COM1</value>            </setting>            <setting name="stopbits" serializeAs="String">                <value>1</value>a            </setting>            <setting name="baudrate" serializeAs="String">                <value>115200</value>            </setting>            <setting name="databits" serializeAs="String">                <value>8</value>            </setting>            <setting name="parity" serializeAs="String">                <value>None</value>            </setting>        </BmpProject.Properties.Settings>    </userSettings></configuration>