03 2016 档案
文件打开保存
摘要:/// /// 打开文件 /// /// /// private void btnFile_Click(object sender, EventArgs e) { using (OpenFileDialog openFile = new OpenFileDialog... 阅读全文
posted @ 2016-03-29 13:10 路上有你F 阅读(186) 评论(0) 推荐(0)
页面间传值的⑤种方法
摘要:5、构造函数传值 第一步 在调用窗体建立构造函数 写入参数ex: public Form2(Sting msg):this() //调用无参的构造函数 { label1.text=msg } 第二步 传值窗体构造调用窗体的实例 ex: string txtMsg=textBox1.text; For 阅读全文
posted @ 2016-03-28 17:29 路上有你F 阅读(302) 评论(0) 推荐(0)
自定义泛型类 泛型方法 泛型接口
摘要:/// /// 自定义泛型类 /// /// class MyClass { //字段 T[] name = null; /// /// 构造函数 /// //... 阅读全文
posted @ 2016-03-25 16:21 路上有你F 阅读(246) 评论(0) 推荐(0)
.net 图片上传
摘要:C#上传图片和生成缩略图以及图片预览 因工作需要,上传图片要增加MIME类型验证和生成较小尺寸的图片用于浏览。根据网上代码加以修改做出如下效果图: 前台代码如下: 1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <head runat="server" 阅读全文
posted @ 2016-03-25 13:50 路上有你F 阅读(484) 评论(0) 推荐(0)
字符串做只读char类型数组的转换
摘要://字符串为只读数组 string str = "abcdefghijk"; //字符串转换为char类型数组 char[] chs = str.ToCharArray(); chs[0] = 'b'; //把char类型数组转换为字符串 string newStr = new string(chs 阅读全文
posted @ 2016-03-25 12:54 路上有你F 阅读(331) 评论(0) 推荐(0)
自定义类集合元素遍历 枚举
摘要:Student s = new Student(); List<Student> list = new List<Student>(); s.Height = "19"; s.Weight = "100KG"; s.Gender = "男"; list.Add(s); //List<int> lis 阅读全文
posted @ 2016-03-11 17:06 路上有你F 阅读(383) 评论(0) 推荐(0)