会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
伟二哥
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
下一页
2014年10月27日
c# 中的Action<> 和 Func<>
摘要: 原文链接:http://www.2cto.com/kf/201301/186760.html其实他们两个都是委托【代理】的简写形式。一、【action】指定那些只有输入参数,没有返回值的委托Delegate的代码:[csharp] public delegate void myDelegate(st...
阅读全文
posted @ 2014-10-27 18:13 二哥(阿伟)
阅读(180)
评论(0)
推荐(0)
2014年10月21日
c# 编程中常用的一些方法
摘要: 1.判断一个字符串是否全是数字 /// /// 判断字符串是否全是数字 /// /// /// public static bool IsNumber(string str) { ...
阅读全文
posted @ 2014-10-21 10:23 二哥(阿伟)
阅读(276)
评论(0)
推荐(0)
2014年10月9日
不借助第三个变量,实现两个整数互换值
摘要: 1.相加运行int a = 10;int b = 5;a= a+b;b=a-b;a=a-b;2.异或运算int a = 10;int b = 5;a ^= b;b ^= a;a ^= b;3.直接赋值b = a + (a = b) * 0; 无溢出风险a = a + b - (b = a); 有溢出...
阅读全文
posted @ 2014-10-09 12:57 二哥(阿伟)
阅读(335)
评论(0)
推荐(0)
2014年9月30日
ExcelHelper
摘要: using System;using System.Collections.Generic;using System.Web;using System.Web.UI.WebControls;using System.IO;using System.Data;using System.Data.Ole...
阅读全文
posted @ 2014-09-30 14:35 二哥(阿伟)
阅读(360)
评论(0)
推荐(0)
2014年9月22日
c# 文件的读写
摘要: 读文件: 1 StreamReader sr = new StreamReader(FileName, Encoding.Default); 2 string content = ""; 3 content = sr.ReadLine...
阅读全文
posted @ 2014-09-22 15:36 二哥(阿伟)
阅读(129)
评论(0)
推荐(0)
Wav文件操作类
摘要: internal class WaveFile { #region 字段和属性 //文件路径 private string filepath; //文件详情对象 private FileInfo fileInfo; ...
阅读全文
posted @ 2014-09-22 15:23 二哥(阿伟)
阅读(523)
评论(0)
推荐(0)
2014年4月17日
c# & (与) 、^ (异或)和 >>(<<位移运算)
摘要: &:与 运算 1.&操作两个bool类型的值,和&&类似。 if( fun1() & fun2() )两个函数都会执行;if( fun1() && fun2() ) 如果fun1()为false,fun2()不会执行 2.& "与"运算 操作两个int或short 类型。 0&0==0; 0&1 =...
阅读全文
posted @ 2014-04-17 17:23 二哥(阿伟)
阅读(5036)
评论(1)
推荐(2)
2014年4月3日
c# 高精度的timer
摘要: 核心代码摘自 http://www.codeproject.com/Articles/98346/Microsecond-and-Millisecond-NET-Timer想用c# (winform)做一个毫秒级别的计时器,发现微软自带的Timer控件经度不够。找到了这段代码,大意是用的 类 Sys...
阅读全文
posted @ 2014-04-03 16:06 二哥(阿伟)
阅读(3044)
评论(0)
推荐(0)
2014年3月13日
c# 生成txt文件,写入内容
摘要: string path = Application.StartupPath + "\\" + "timeLenth.txt"; FileStream fs1 = new FileStream(path, FileMode.Create, FileAccess.Write);//搜索创建写入文件 StreamWriter sw = new StreamWriter(fs1); sw.Write("Content no other line"); sw.Write(" ...
阅读全文
posted @ 2014-03-13 16:49 二哥(阿伟)
阅读(2394)
评论(0)
推荐(0)
C# 对 list<T>中的数据按某字段的大小进行排序
摘要: 如T为 classstudent(){ string name; int age;}按age大小排序写法一:students.Sort((student1,student2)=>student1.age-student2.age);写法二:void SortStudents(List students) { students.Sort(Comparison); } private int Comparison(student student1, student student2) { return student1.age - student2.age; }
阅读全文
posted @ 2014-03-13 09:40 二哥(阿伟)
阅读(2627)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
下一页
公告