資源簡介
適合各種config 以及自定義配置
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
namespace?Common
{
????///?
????///??讀寫xml類
????///??適合各種config?以及自定義配置
????///?
????public?static?class?Global
????{
????????///?
????????///?保存xml
????????///?
????????///?
????????///?
????????///?
????????public?static?bool?SaveConfig(string?key?string?value)
????????{
????????????xmlDocument?doc?=?new?xmlDocument();
????????????//獲得配置文件的全路徑
????????????string?strFileName?=?System.AppDomain.CurrentDomain.baseDirectory?+?“\\DLTiClient.exe.config“;
????????????//加載xml
????????????doc.Load(strFileName);
????????????//找出名稱為“appSettings”的所有元素
????????????xmlNodeLis
- 上一篇:SQLHelper連接數據庫類
- 下一篇:C# 漢字轉為拼音
評論
共有 條評論