using System; using System.Data; using System.Text; using System.IO; namespace TestApp { class Program { static void Main() { DataSet ds = new DataSet("carRepairs"); string path = Environment.CurrentDirectory; path = Directory.GetParent(path).FullName; path = Directory.GetParent(path).FullName; path = Path.Combine(path, "toucai.xsd"); ds.ReadXmlSchema(path); Console.WriteLine(ds.Tables.Count); } } }
最后的运行结果为4,而path的值在本机为:C:\Users\青松\documents\visual studio 2013\Projects\TestApp\TestApp\toucai.xsd
时间: 2024-10-05 18:11:23