摘要: c# 获取文件最后修改日期代码FileInfo f = new FileInfo(@"c:\1.txt");Console.WriteLine(f.LastWriteTime.ToString());c# 获取文件最后访问时间代码FileInfo f = new FileInfo(@"c:\1.tx 阅读全文
posted @ 2016-11-18 19:40 飞翔的阿基米德 阅读(5372) 评论(1) 推荐(1) 编辑
摘要: 1.创建文件夹 //using System.IO; Directory.CreateDirectory(%%1); 2.创建文件 //using System.IO; File.Create(%%1); 3.删除文件 //using System.IO; File.Delete(%%1); 4.删 阅读全文
posted @ 2016-11-17 21:19 飞翔的阿基米德 阅读(577) 评论(0) 推荐(3) 编辑
摘要: cout<<"C1="<<setiosflags(ios::fixed)<<setprecision(2)<<3.14*r*2<<endl; cout<<"Sa="<<setiosflags(ios::fixed)<<setprecision(2)<<3.14*r*r<<endl; cout<<"S 阅读全文
posted @ 2016-11-01 10:46 飞翔的阿基米德 阅读(1512) 评论(1) 推荐(0) 编辑
摘要: 说明:几个简单的基本的sql语句 选择:select * from table1 where 范围 插入:insert into table1(field1,field2) values(value1,value2) 删除:delete from table1 where 范围 更新:update 阅读全文
posted @ 2016-05-25 16:58 飞翔的阿基米德 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1。属性 关键:get,set public class Account { private string id; private decimal money; public string Id { get{return id;} } public decimal Money { get{retur 阅读全文
posted @ 2016-05-06 16:45 飞翔的阿基米德 阅读(134) 评论(0) 推荐(0) 编辑
摘要: get是给属性赋值,set是取属性的值。 get、set用法: 一是隐藏组件或类内部的真是成员; 二是用来建立约束的,比如,实现“有我没你”这种约束; 三是用来响应属性变化事件,当属性变化是做某事,只要写在set方法里就行。 当你想读出或写入属性的值时,存取标志限定了被实现的语句。用于读出属性的值的 阅读全文
posted @ 2016-04-25 21:01 飞翔的阿基米德 阅读(779) 评论(0) 推荐(0) 编辑
摘要: 1.类型判断 操作符:is 通常是在类型转换前使用,避免或减少转换失败的情况发生 格式: e is T 左操作数e要求的是一个变量或表达式,右侧操作数T要求本身就是一个类型 String o="abc"; console.writeline(o is String);//输出True console 阅读全文
posted @ 2016-04-25 20:41 飞翔的阿基米德 阅读(180) 评论(0) 推荐(1) 编辑
摘要: 1.取补运算 操作符:~ 操作数:限定int,uint,long,ulong和枚举类型,返回值于操作数类型相同 sbyte,byte,short,ushort,也可以运算,但运算前都将隐式转换为int或uint返回值也是int或uint 取补运算:将操作数的二进制每一位取反0变成1,1变成0 例:s 阅读全文
posted @ 2016-04-25 19:16 飞翔的阿基米德 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 1.引用型参数: 关键字:ref 2.输出型参数 关键字:out 例: double area(out double p) { double t=3.14*10; p=2*t*3.14; return t; } 使用时: double p; double a=area(out p); 之后 p 就得 阅读全文
posted @ 2016-04-22 13:25 飞翔的阿基米德 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1.C#中是不允许用new操作符创建String对象的,编译器会报错。 2.实例字段:使用new对class创建对象直接赋初始值,不适用于struct slass Rect { public int x=1; public int y=1; } Rect a=new Rect(); 4:public 阅读全文
posted @ 2016-04-20 21:01 飞翔的阿基米德 阅读(199) 评论(0) 推荐(0) 编辑