C#中配置文件保存的路径

http://www.codeproject.com/Tips/350010/Saving-User-Settings-in-Winform-Application

外网上找的资料

 

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

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

C:\Users\Administrator\AppData\Local\公司名称\程序\版本\

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>

 winform中setting的几个方法http://blog.sina.com.cn/s/blog_685790700100zavh.html

你可能感兴趣的:(配置文件)