.NET 获得指定XML配置文件内容
生活随笔
收集整理的這篇文章主要介紹了
.NET 获得指定XML配置文件内容
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/// <summary>/// 獲得指定XML文件內容/// </summary>/// <param name="strPath">XML文件相對路徑</param>/// <returns>XML數據</returns>public static DataTable GetConfigXml(string strPath){DataTable dt = null;try{DataSet ds = new DataSet();ds.ReadXml(HttpContext.Current.Server.MapPath(strPath));dt = ds.Tables[0];}catch { }return dt;}
??
轉載于:https://www.cnblogs.com/Warmsunshine/p/8430099.html
總結
以上是生活随笔為你收集整理的.NET 获得指定XML配置文件内容的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HDU4686 Arc of Dream
- 下一篇: 组件 -——SUl Mobile