1.在vs中设计要存储的字段,如:zbl,注意范围选择用户

读取:

var aa = Properties.Settings.Default.zbl;

写入:

Properties.Settings.Default.zbl = "dfafdafdas";

保存:

 Properties.Settings.Default.Save();

保存位置:

win7系统

C:\Documents and Settings\Administrator\AppData\Local\Application Data\ComponentCopyProtection\ComponentCopyProtection.v_Url_d45ohcntzmqcq5j2rsrni1qnp0k22kwe\1.0.0.0\user.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <userSettings>
        <ComponentCopyProtection.Properties.Settings>
            <setting name="zbl" serializeAs="String">
                <value>dfafdafdas</value>
            </setting>
        </ComponentCopyProtection.Properties.Settings>
    </userSettings>
</configuration>

默认Documents and Settings拒绝访问,

授权方法参考:http://blog.sina.com.cn/s/blog_76980a410100qjnn.html 

目录解析参考:http://blog.csdn.net/netcoder/article/details/3265846

 

相关文章:

  • 2021-07-07
  • 2021-11-17
  • 2021-08-21
  • 2021-10-01
  • 2021-05-30
  • 2021-11-17
猜你喜欢
  • 2022-02-03
  • 2021-11-14
  • 2021-08-08
相关资源
相似解决方案