简单的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,String,url,dataset)