摘要:
1.创建文件夹//using System.IO;Directory.CreateDirectory(%%1);2.创建文件//using System.IO;File.Create(%%1);3.删除文件//using System.IO;File.Delete(%%1);4.删除文件夹//using System.IO;Directory.Delete(%%1);5.删除一个目录下所有的文件夹//using System.IO;foreach (string dirStr in Directory.GetDirectories(%%1)){DirectoryInfo dir = new D 阅读全文
posted @ 2012-07-13 12:45
Alice_oneone
阅读(317)
评论(0)
推荐(0)
摘要:
替换 阅读全文
posted @ 2012-07-13 12:26
Alice_oneone
阅读(114)
评论(0)
推荐(0)
摘要:
//DateTime 数字型 System.DateTime currentTime=new System.DateTime(); //取当前年月日时分秒 currentTime=System.DateTime.Now; //取当前年 int 年=currentTime.Year; //取当前月 int 月=currentTime.Month; //取当前日 int 日=currentTime.Day; //取当前时 int 时=currentTime.Hour; //取当前分 int 分=currentTime.Minute; //取当前秒 int 秒=currentTime.Second; 阅读全文
posted @ 2012-07-13 12:24
Alice_oneone
阅读(101)
评论(0)
推荐(0)
摘要:
格式字符串转日期datestr="2009-4-25";DateTime date=DateTime.Parse(datestr).AddHours(8);日期加减方法一: DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd")方法二: TimeSpan span = new DateTime(2005,2,11,22,22,44,555) - new DateTime(2004,9,1,1,1,1,1); int int_day=span.Days; int int_hour=span.Hours; int 阅读全文
posted @ 2012-07-13 12:21
Alice_oneone
阅读(280)
评论(0)
推荐(0)
摘要:
System.IO 类目录操作string[] drives = Directory.GetLogicalDrives(); //本地驱动器的名,如:C:\等string path = Directory.GetCurrentDirectory();//获取应用程序的当前工作目录Path.GetFileName(@"c:\dir\file.txt"); //获取子目录的名字,result的结果是file.txtDirectory.GetFiles(路径及文件名) //获取指定目录中的文件名(文件列表)DirectoryInfo di = new DirectoryInfo( 阅读全文
posted @ 2012-07-13 11:30
Alice_oneone
阅读(167)
评论(0)
推荐(0)
浙公网安备 33010602011771号