12 2012 档案
摘要:/// <summary> /// 实现一个静态方法将指定文件夹下面的所有内容copy到目标文件夹下面/如果目标文件夹为只读属性就会报错。 /// </summary> /// <param name="srcPath">复制路径</param> /// <param name="aimPath">目标路径</param> public static void CopyDir(string srcPath, string aimPath) { try { // 检查目标目录是否以目录
阅读全文
摘要:It doesn't really matter who you used to be,what matters is who you've become.过去的你是什么熊样不重要,重要的是现在的你是怎么个牛样。Life begins at the end of your comfort zone.真正的生活开始于走出安乐窝。How much truth of heart in one's life is told in a joke?一辈子,有多少真心话,是以玩笑的方式说了出去?Where there's no expectation,losing won&#
阅读全文
摘要:/// <summary> /// 递归删除文件夹及包含的文件 /// </summary> /// <param name="dir">文件夹物理路径</param> private void DeleteFolder(string dir) { if (Directory.Exists(dir))//如果存在这个文件夹删除之 { foreach (string d in Directory.GetFileSystemEntries(dir)) { if (File.Exists(d)) { File.Delete(d);/
阅读全文
摘要:1.首先需要一个集合用来测试://定义一个集合要用的类:public class People{ public People(string name, string sex, int age,decimal height) { this.Name = name; this.Sex = sex; this.Age = age; this.Height = height; } public string Name { get; set; } public string Sex { get; set; } public int Age { get; set; } public decimal Hei
阅读全文
摘要:1.显示格式为: 当前时间: 2011年12月06日 17:00:00 星期四function showTime() { var now = new Date(); var nowTime = now.toLocaleString(); var date = nowTime.substring(0,10);//截取日期 var time = nowTime.substring(10,20); //截取时间 var week = now.getDay(); //星期 var hour = now.getHours(); //小时 //判断星期几 var weeks = ["日"
阅读全文
摘要:var myDate = new Date();myDate.getYear(); //获取当前年份(2位)myDate.getFullYear(); //获取完整的年份(4位,1970-????)myDate.getMonth(); //获取当前月份(0-11,0代表1月)myDate.getDate(); //获取当前日(1-31)myDate.getDay(); //获取当前星期X(0-6,0代表星期天)myDate.getTime(); //获取当前时间(从1970.1.1开始的毫秒数)myDate.getHours(); //获取当前小时数(0-23)myDate.getMinute
阅读全文