解决方案 »
- 对 ADO.NET 的两点认识,请指教请确认
- 演练:在 Windows 应用程序中创建一个用于搜索数据的窗体
- 反序列化中的面向接口思路?
- 关于TransactionScope 事务的问题.
- 怎样动态复制表结构?
- winform里面怎么实现窗体关闭时提示是否保存对话框(含YesNoCancel),但选择了Cancel后返回窗体不关闭
- 如何合并两个数据集中的表?
- lblResult.Items.Add("node value:"+node.FirstChild.Value );//????????此句有问题不能通过编译 。
- C# 2008 报表数据更新的问题?
- 淡入或淡出的窗口为什么是黑色透明的呢?
- C#操作EXCEL,更改柱状图的数据范围,怎么实现呢?
- win7 64位ComputeSignature(signer)签名出错
DirectoryInfo info = new DirectoryInfo(p);
String path1 = info.Parent.Parent.Parent.FullName;
比如
c:\a\b\..\
等于
c:\a\
string path = @"C:\A\B\C\D\E\1.txt ";
DirectoryInfo info = new DirectoryInfo(path);
string ePath = info.Parent.FullName;//E文件夹路径 C:\A\B\C\D\E
string dPath = info.Parent.Parent.FullName;//D文件夹路径 C:\A\B\C\D
string cPath = info.Parent.Parent.Parent.FullName;//C文件夹路径 C:\A\B\C
string rootpath = info.Root.FullName;//根目录; C:\ Console.WriteLine(ePath);
Console.WriteLine(dPath);
Console.WriteLine(cPath);
Console.WriteLine(rootpath);
Console.Read();