读取txt嘛
曾经这样实现过
const string path = @"D:/test.txt";
var smRead = new StreamReader(path, System.Text.Encoding.Default); //设置路径
var line = smRead.ReadLine();
最近程序中有设计读取xml
大致是
var xmldoc = new XmlDocument();
var xmlPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data\\SSOConfig.xml");
xmldoc.Load(xmlPath);
var reader = new XmlNodeReader(xmldoc);
var ds = new DataSet();
ds.ReadXml(reader);
reader.Close();
希望对你有帮助...... |