2011年7月8日

Asp.net 生成PDF

摘要: using System.IO;using iTextSharp.text.pdf;using iTextSharp.text;using iTextSharp.text.html.simpleparser;using System.Text;public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } //iTextsharp 给PDF文件添加水印,是通过 PdfWriter 的 PageEvent 事件来处理的,此事件,需要继承 Pd 阅读全文

posted @ 2011-07-08 14:14 缘来 阅读(789) 评论(0) 推荐(0)

asp.net 模板生成Excel

摘要: using Microsoft.Office.Interop.Excel;using System.Reflection;using System.Diagnostics;using Microsoft.Win32;using System.IO; protected void Button1_Click(object sender, EventArgs e) { //建立一个Excel.Application的新进程 Microsoft.Office.Interop.Excel.Application app = new Microsoft.Office.Interop.Excel.Appl 阅读全文

posted @ 2011-07-08 13:49 缘来 阅读(1149) 评论(2) 推荐(0)

2011年6月20日

UDP

摘要: namespace UDPServer{ public partial class Form1 : Form { UdpClient uc; //声明UDPClient //UdpClient uc2; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { uc = new UdpClient(); //初始化 uc.Connect(IPAddress.Parse("192.168.1.41"), 8888); //uc2 = ne 阅读全文

posted @ 2011-06-20 09:34 缘来 阅读(406) 评论(0) 推荐(0)

2011年6月14日

生成缩略图和添加水印

摘要: using System.IO;using System.Drawing.Imaging ;using System.Drawing;protected void Button1_Click(object sender, EventArgs e) { Graphics g=null; System.Drawing.Image upimage=null; System.Drawing.Image thumimg=null; System.Drawing.Image simage=null; Bitmap outputfile=null; try { string extension = Path 阅读全文

posted @ 2011-06-14 14:46 缘来 阅读(235) 评论(0) 推荐(0)

2011年6月13日

子类继承父类的实例化顺序

摘要: 当两个类之间有继承关系时,第一次构造子类的实例时,是按照如下顺序进行的: 子类的静态成员初始化语句 子类的静态构造函数 子类的非静态成员初始化语句 父类的静态成员初始化语句 父类的静态构造函数 父类的非静态成员初始化语句 父类的构造函数 子类的构造函数 阅读全文

posted @ 2011-06-13 16:09 缘来 阅读(510) 评论(0) 推荐(0)

2011年5月19日

同时对两列进行排列 listview

摘要: //初始化里面s ListViewColumnSorter lic1 = new ListViewColumnSorter(); lic1.SortColumn = 2; this.listView1.ListViewItemSorter = lic1; //listView1.Sort();public class ListViewColumnSorter : IComparer { private int ColumnToSort; private SortOrder OrderOfSort; private readonly CaseInsensitiveComparer ObjectC 阅读全文

posted @ 2011-05-19 10:36 缘来 阅读(615) 评论(0) 推荐(0)

2011年5月18日

ListView 排序

摘要: #region ListView 排序 private int sortColumn = -1; private void listView1_ColumnClick(object sender, ColumnClickEventArgs e) { if (e.Column != sortColumn) { // Set the sort column to the new column. sortColumn = e.Column; // Set the sort order to ascending by default. listView1.Sorting = SortOrder.Asc 阅读全文

posted @ 2011-05-18 09:59 缘来 阅读(336) 评论(0) 推荐(1)

2011年5月6日

asp.net注册、局部刷新用户名检测+验证码

摘要: Register.aspx<head runat="server"> <title>无标题页</title> <script language="javascript" type="text/javascript" > var request=false; try{ request=new XMLHttpRequest(); }catch(trymicrosoft){ try{ request=new ActiveXObject("Msxml2.XMLHTTP"); 阅读全文

posted @ 2011-05-06 13:29 缘来 阅读(617) 评论(0) 推荐(0)

2011年5月5日

不同浏览器创建XMLHttpRequest

摘要: <script language="javascript" type="text/javascript" > var request=false; try{ request=new XMLHttpRequest(); }catch(trymicrosoft){ try{ request=new ActiveXObject("Msxml2.XMLHTTP"); }catch(othermicrosoft){ try{ request=new ActiveXObject("Microsoft.XMLHTTP" 阅读全文

posted @ 2011-05-05 12:40 缘来 阅读(159) 评论(0) 推荐(0)

2011年5月3日

WebService 异步调用

摘要: protected void Page_Load(object sender, EventArgs e) { Service service = new localhost.Service(); service.HelloWorldCompleted += new HelloWorldCompletedEventHandler(callback); service.HelloWorldAsync(); } public void callback(object sender, HelloWorldCompletedEventArgs e) { if (e.Error == null) { Re 阅读全文

posted @ 2011-05-03 09:59 缘来 阅读(134) 评论(0) 推荐(0)

导航