Net Core教程

C# 保存程序数据 setting文件

本文主要是介绍C# 保存程序数据 setting文件,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

源码

        //加载数据
        private void Form1_Load(object sender, EventArgs e)
        {
            PATHqq.Text = SettingsPath.Default.qq;
            PATHwechat.Text = SettingsPath.Default.wechat;
            PATHdingding.Text = SettingsPath.Default.dingding;
            PATHvm.Text = SettingsPath.Default.vm;
            PATHocr.Text = SettingsPath.Default.ocr;
            PATHmubu.Text = SettingsPath.Default.mubu;
        }
        //保存数据
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            SettingsPath.Default.qq = PATHqq.Text;
            SettingsPath.Default.wechat = PATHwechat.Text;
            SettingsPath.Default.dingding = PATHdingding.Text;
            SettingsPath.Default.vm = PATHvm.Text;
            SettingsPath.Default.ocr = PATHocr.Text;
            SettingsPath.Default.mubu = PATHmubu.Text;
            SettingsPath.Default.Save();

这篇关于C# 保存程序数据 setting文件的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!