zoukankan      html  css  js  c++  java
  • [问]VS2005,C#winform程序,代码修改app.config的结果保存到哪里了?

    [问]VS2005,C#winform程序,代码修改app.config的结果保存到哪里了?

    通过Properties.Settings用代码形式读写app.config文件,其中Properties.Settings变量的范围"scope"都设置为用户"user"(注:如果改为"Application",编译时系统提示其为只读属性),读写都正常,并且重新打开exe文件时,上次输入的值仍然存在,但是手动打开"test.exe.config",所有的设置变量值均为空,写入的值都保存到什么地方去了呢?临时文件?我用360安全卫士清除临时文件后在此打开exe文件,上次输入的值依然存在。有谁知道这是怎么回事?

    示例代码:
    private void button1_Click(object sender, EventArgs e)

       //读操作,将读到的值送textBox1显示 
       Properties.Settings config = Properties.Settings.Default; 
       textBox1.Text = config.myvar;
    }

    private void button2_Click(object sender, EventArgs e)

       //写操作,将textBox2里的值写入myvar 
       Properties.Settings config = Properties.Settings.Default; 
       config.myvar = textBox2.Text; 
       config.Save();
    }
  • 相关阅读:
    xt
    UVA 10200 Prime Time (打表)
    CodeForces 540B School Marks
    CodeForces 540C Ice Cave (BFS)
    poj 3250 Bad Hair Day(栈的运用)
    hdu A Magic Lamp
    hdu 4325 Flowers(区间离散化)
    hdu 5500 Reorder the Books
    V2X之标准
    V2X的前生今世
  • 原文地址:https://www.cnblogs.com/twzheng/p/1110780.html
Copyright © 2011-2022 走看看