zoukankan      html  css  js  c++  java
  • 读写配置文件类和全局类调用的具体用法

    1.读取配置文件(app.config)
    1ConfigSettings settings=Global.GetInstance().Settings;
    2    //textbox赋值        tbUserName.Text=settings.GetString(SettingKey.MailUserName.ToString());
    3            tbPwd.Text=settings.GetString(SettingKey.MailPassWord.ToString());
    4            tbPOP3.Text=settings.GetString(SettingKey.MailPOP3ServerAddress.ToString());
    5            tbSMTP.Text=settings.GetString(SettingKey.MailSMTPServerAddress.ToString());
    6            tbPort.Text=settings.GetString(SettingKey.MailPOP3Port.ToString());
    7            tbReceiveAddress.Text=settings.GetString(SettingKey.MailRecipientsAddress.ToString());
    8            tbMailAddress.Text=settings.GetString(SettingKey.MailAddress.ToString());

    2.设置配置文件中各项值
    1ConfigSettings settings=Global.GetInstance().Settings;
    2                settings.SetValue(SettingKey.MailUserName.ToString(),tbUserName.Text.Trim());
    3                settings.SetValue(SettingKey.MailPassWord.ToString(),tbPwd.Text.Trim());
    4                settings.SetValue(SettingKey.MailPOP3ServerAddress.ToString(),tbPOP3.Text.Trim());
    5                settings.SetValue(SettingKey.MailSMTPServerAddress.ToString(),tbSMTP.Text.Trim());
    6                settings.SetValue(SettingKey.MailPOP3Port.ToString(),tbPort.Text.Trim());
    7                settings.SetValue(SettingKey.MailRecipientsAddress.ToString(),tbReceiveAddress.Text.Trim());
    8                settings.SetValue(SettingKey.MailAddress.ToString(),tbMailAddress.Text.Trim());

    3.注意:调用此类前要using configSetting所在的命名空间,此例中为sss_system.class;
  • 相关阅读:
    Sails v1.0使用指南
    sails0.12相关命令
    vs code 快捷键
    nodejs相关框架
    sails 相关软件下载地址及命令
    UltraISO安装windows10时0x8007000D错误解决办法
    C# HtmlElement的GetAttribute("class") return ""
    Android如何实现TCP和UDP传输
    android 获取view在屏幕中的位置
    八款Android 开发者必备的小工具
  • 原文地址:https://www.cnblogs.com/telephoner/p/174591.html
Copyright © 2011-2022 走看看