随笔分类 -  C#

摘要:转自:http://www.cnblogs.com/yelaiju/archive/2010/10/03/1841521.html /// /// 获取WebBrowser指定的图片 /// /// 需要获取图片的WebBrowser /// 指定的图片的id(优先查找指定id)... 阅读全文
posted @ 2011-04-21 19:49 Crazy Coder 阅读(6012) 评论(0) 推荐(2) 编辑
摘要:以进度1-100为例 创建类 Press namespace WindowsFormsApplication1{ class PressValue : EventArgs { public int value { set; get; } ... 阅读全文
posted @ 2011-04-18 23:54 Crazy Coder 阅读(1424) 评论(0) 推荐(0) 编辑
摘要:WebService有两个方法: [WebMethod(EnableSession = true)] public bool Login(string strName) { Session["UserName"] = strName; } [WebMethod... 阅读全文
posted @ 2011-04-18 20:24 Crazy Coder 阅读(1927) 评论(0) 推荐(0) 编辑
摘要:WebForm: private string GetMd5(string ps) { return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(ps,"MD... 阅读全文
posted @ 2011-04-18 19:32 Crazy Coder 阅读(807) 评论(0) 推荐(0) 编辑
摘要:private void CreateImage(string checkCode) { int iwidth = (int)(checkCode.Length * 15); System.Drawing.Bitmap image = new... 阅读全文
posted @ 2011-04-09 16:22 Crazy Coder 阅读(400) 评论(0) 推荐(0) 编辑
摘要:不同的ContentType 会影响客户端所看到的效果.默认的ContentType为 text/html 也就是网页格式. 代码如: 显示的为网页,而 则会显示html原代码. 以下为一些常用的 ContentType GIF images JPEG images TIFF im... 阅读全文
posted @ 2011-04-09 15:31 Crazy Coder 阅读(327) 评论(0) 推荐(0) 编辑
摘要:private bool CheckCardNumber(string number) { int[] iW = new int[] { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1 }; int iSum = 0; ... 阅读全文
posted @ 2011-04-09 14:21 Crazy Coder 阅读(617) 评论(0) 推荐(0) 编辑
摘要:元字符 说明 ^ 匹配字符串的开始位置 $ 匹配字符串的结束位置 . 匹配任意单个字符(换行符 \n 除外) | 交替 {…} 指定要限定的数量 [...] 指定要匹配的字符集 (…) 对表达式进行逻辑分组 * 匹配零或多个前面的表达式 + 匹配一或多个前面的表达式 ? 匹配零或一个前面的表达式 \... 阅读全文
posted @ 2011-04-09 14:19 Crazy Coder 阅读(404) 评论(0) 推荐(0) 编辑
摘要:RichTextBox默认情况下会根据用户输入的字符来自动设置字体样式,要想让输入保持制定的格式需要设置它的LanguageOption属性。 设置代码为: this.RichTextBox1.LanguageOption = RichTextBoxLanguageOptions.UIFonts; 阅读全文
posted @ 2011-04-08 16:37 Crazy Coder 阅读(682) 评论(0) 推荐(0) 编辑
摘要:private void FrmMain_FormClosing(object sender, FormClosingEventArgs e){ System.Environment.Exit(System.Environment.ExitCode); ... 阅读全文
posted @ 2011-04-08 13:50 Crazy Coder 阅读(776) 评论(0) 推荐(0) 编辑
摘要:this.TextBox1.Invoke(new MethodInvoker(delegate() { this.TextBox1.Text = "即使是跨线程,仍然可以操作!";})); 阅读全文
posted @ 2011-04-02 00:26 Crazy Coder 阅读(393) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示