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; }

你可能感兴趣的:(xml)