码迷,mamicode.com
首页 > 其他好文 > 详细

目录操作-SYSTEM.IO

时间:2015-01-08 21:30:23      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

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

标签:

原文地址:http://www.cnblogs.com/lqs2011/p/4211842.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!