随笔分类 - C#
摘要:转自:http://www.cnblogs.com/yelaiju/archive/2010/10/03/1841521.html /// /// 获取WebBrowser指定的图片 /// /// 需要获取图片的WebBrowser /// 指定的图片的id(优先查找指定id)...
阅读全文
摘要:以进度1-100为例 创建类 Press namespace WindowsFormsApplication1{ class PressValue : EventArgs { public int value { set; get; } ...
阅读全文
摘要:WebService有两个方法: [WebMethod(EnableSession = true)] public bool Login(string strName) { Session["UserName"] = strName; } [WebMethod...
阅读全文
摘要:WebForm: private string GetMd5(string ps) { return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(ps,"MD...
阅读全文
摘要:private void CreateImage(string checkCode) { int iwidth = (int)(checkCode.Length * 15); System.Drawing.Bitmap image = new...
阅读全文
摘要:不同的ContentType 会影响客户端所看到的效果.默认的ContentType为 text/html 也就是网页格式. 代码如: 显示的为网页,而 则会显示html原代码. 以下为一些常用的 ContentType GIF images JPEG images TIFF im...
阅读全文
摘要: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; ...
阅读全文
摘要:元字符 说明 ^ 匹配字符串的开始位置 $ 匹配字符串的结束位置 . 匹配任意单个字符(换行符 \n 除外) | 交替 {…} 指定要限定的数量 [...] 指定要匹配的字符集 (…) 对表达式进行逻辑分组 * 匹配零或多个前面的表达式 + 匹配一或多个前面的表达式 ? 匹配零或一个前面的表达式 \...
阅读全文
摘要:RichTextBox默认情况下会根据用户输入的字符来自动设置字体样式,要想让输入保持制定的格式需要设置它的LanguageOption属性。 设置代码为: this.RichTextBox1.LanguageOption = RichTextBoxLanguageOptions.UIFonts;
阅读全文
摘要:private void FrmMain_FormClosing(object sender, FormClosingEventArgs e){ System.Environment.Exit(System.Environment.ExitCode); ...
阅读全文
摘要:this.TextBox1.Invoke(new MethodInvoker(delegate() { this.TextBox1.Text = "即使是跨线程,仍然可以操作!";}));
阅读全文