标签:
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
标签:
原文地址:http://www.cnblogs.com/lqs2011/p/4211842.html