摘要: using System;using System.Web;public class FileUp : IHttpHandler { string modelPath = "model.htm"; string strHtml = ""; public void ProcessRequest (HttpContext context) { System.Web.UI.WebControls.Button btn = new System.Web.UI.WebControls.Button(); //尝试检查浏览器是否传递过来一个叫 isPostBa... 阅读全文
posted @ 2014-02-08 17:56 南瓜asp 阅读(133) 评论(0) 推荐(0)
摘要: 1 2 3 using System; 4 using System.Web; 5 using System.Drawing; 6 7 public class MakeImg : IHttpHandler { 8 9 public void ProcessRequest (HttpContext context) {10 context.Response.ContentType = "image/jpg";//告诉浏览器以什么编码方式处理2进制流11 string imgPath="upload\\1.jpg";12 ... 阅读全文
posted @ 2014-02-08 16:19 南瓜asp 阅读(229) 评论(0) 推荐(0)
摘要: public partial class Form1 : Form { public Form1() { InitializeComponent(); TextBox.CheckForIllegalCrossThreadCalls = false; } //负责监听端口 Socket sokWelcome = null; //负责和客户端socket通信 Socket sokConnection = null; //负责监听的线程 ... 阅读全文
posted @ 2013-12-25 18:44 南瓜asp 阅读(154) 评论(0) 推荐(0)
摘要: linq是微软提供的一堆扩展方法。通过例子熟悉。对int数组元素进行筛选 , int[] values = { 3, 5, 9, 8, 2, 20, -5, -9, 306 }; IEnumerable e1 = values.Where(i => i > 10); foreach (int i in e1) { Console.WriteLine(i); }可以用var进行类型推断,过滤掉负数,把数组排序,然后元素两边加【】输出简化var e1 = va... 阅读全文
posted @ 2013-12-13 16:50 南瓜asp 阅读(262) 评论(0) 推荐(0)
摘要: .:匹配任何单个字符。例如正则表达式“b.g”能匹配如下字符串:“big”、“bug”、“b g”,但是不匹配“buug”,“b..g”可以匹配“buug”。[ ] :匹配括号中的任何一个字符。例如正则表达式“b[aui]g”匹配bug、big和bag,但是不匹配beg、baug。可以在括号中使用连字符“-”来指定字符的区间来简化表示,例如正则表达式[0-9]可以匹配任何数字字符,这样正则表达式“a[0-9]c”等价于“a[0123456789]c”就可以匹配“a0c”、“a1c”、“a2c”等字符串;还可以制定多个区间,例如“[A-Za-z]”可以匹配任何大小写字母,“[A-Za-z0-9. 阅读全文
posted @ 2013-12-13 16:00 南瓜asp 阅读(223) 评论(0) 推荐(0)
摘要: private void MyDrawClock(double h, int m, int s) { Graphics g = this.CreateGraphics(); Rectangle rect = this.ClientRectangle; g.Clear(Color.White); Pen myPen = new Pen(Color.Black,3); g.DrawEllipse(myPen, this.ClientRectangle.Width / 2 - ... 阅读全文
posted @ 2013-12-13 15:18 南瓜asp 阅读(307) 评论(0) 推荐(0)
摘要: 利用委托来实现鼠标三击效果。用户控件using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Linq;u... 阅读全文
posted @ 2013-12-03 11:29 南瓜asp 阅读(183) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2013-11-13 21:36 南瓜asp 阅读(7) 评论(0) 推荐(0)
摘要: OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter="文本文件|*.txt"; if(ofd.ShowDialog()==false) { return; } //IEnumerable lines = // File.ReadLines(ofd.FileName,Encoding.Default); string[] lines = ... 阅读全文
posted @ 2013-11-12 19:39 南瓜asp 阅读(310) 评论(0) 推荐(0)
摘要: //FileStream stream = new FileStream(@"C:\Documents and Settings\Administrator\桌面\2.xls", FileMode.OpenOrCreate, FileAccess.ReadWrite); // HSSFWorkbook workbook=new HSSFWorkbook(stream); //读出来第一个sheet第一列第一行的东东 //HSSFSheet sheet=workbook.GetSheetAt(0);//第一个sheet ... 阅读全文
posted @ 2013-11-11 16:18 南瓜asp 阅读(240) 评论(0) 推荐(0)