c# 得到文件夹名称,应该怎么办??

来源:百度知道 编辑:UC知道 时间:2024/09/24 06:29:37
c# 得到文件夹名称,

我是新手,大家教我

c# 文件操作
C#追加文件
StreamWriter sw = File.AppendText(Server.MapPath(".")+"\\myText.txt");
sw.WriteLine("追逐理想");
sw.WriteLine("kzlll");
sw.WriteLine(".NET笔记");
sw.Flush();
sw.Close();

C#拷贝文件
string OrignFile,NewFile;
OrignFile = Server.MapPath(".")+"\\myText.txt";
NewFile = Server.MapPath(".")+"\\myTextCopy.txt";
File.Copy(OrignFile,NewFile,true);

C#删除文件
string delFile = Server.MapPath(".")+"\\myTextCopy.txt";
File.Delete(delFile);

C#移动文件
string OrignFile,NewFile;
OrignFile = Server.MapPath(".")+"\\myText.txt";
NewFile = Server.MapPath(".")+"\\myTextCopy.txt";
File.Move(OrignFile,NewFile);

C#创建目录
// 创建目录c:\sixAge
DirectoryInfo d