首页 > 代码库 > 目录操作-SYSTEM.IO

目录操作-SYSTEM.IO

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

目录操作-SYSTEM.IO