摘要: 在博客园看到一篇关于Log4Net使用教程,比较详细,感谢这位热心的博主博客园地址:http://www.cnblogs.com/kissazi2/archive/2013/10/29/3393595.html 阅读全文
posted @ 2013-11-04 14:18 徽州猿人 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 计算每个字符出现的次数且打印 3 /// 4 /// 5 public void CharCount(string str) 6 { 7 Dictionary dicCount = new Dictionary(); 8 str = str.ToLower(); 9 foreach (char item in str.ToCharArray())10 {11 ... 阅读全文
posted @ 2013-11-02 23:55 徽州猿人 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 许多网站都会有验证码输入。今天就写个简单验证码控件,新建一个固定图片作为画布,在画布画上随机的4个字符,保存图片。用pictureBox控件装载该图片效果图:外面调用CreateYZM()方法生成验证码,Code属性获取验证码的值,用于验证判断使用每点击验证码,都会重新生成代码如下: 1 //验证码 2 public string Code { get;private set; } 3 //验证码长度 4 private int length = 4; 5 6 7 //是否有噪点 8 private bool ... 阅读全文
posted @ 2013-10-24 16:42 徽州猿人 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 在很多地方,都用到了数据加密,比较多的就是MD5了,也比较安全,下面就贴上个示例,输入一串字符串,通过MD5加密加密算法如下 public static string MD5_Encrypt(string md5_str) { System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5CryptoServiceProvider.Create(); byte[] bytes = System.Text.Encoding.ASCII.GetBytes(md5_str); byte[] bytes1 = md5.Co 阅读全文
posted @ 2013-10-17 16:26 徽州猿人 阅读(325) 评论(0) 推荐(0) 编辑