xml的操作

从文件流读XML

string urlPath = url;
DataSet ds
= new DataSet();
DataTable dt
= new DataTable();
try
{
using (FileStream fs = new FileStream(url, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
ds.ReadXml(fs);
fs.Close();
dt
= ds.Tables["Agents"];
return dt;
}
}
catch { return dt; }

posted @ 2011-02-22 15:55  老皆知  阅读(198)  评论(0编辑  收藏  举报