共 17 篇文章 |
|
A problem I see over and over again on the ASP.NET forums is the following:
In a login page, if the user and password have been validated, the page developer wants to redirect to the default page. To do this, he writes the following code:
Session["Login"] = true;
Response.Redirect("~/default.aspx&quo... 阅383 转1 评0 公众公开 08-09-25 03:00 |
//按钮数量计算器在每次按钮按动后加"1"counter += 1 ;//对要产生的按钮的纵坐标的相对位置是前一个产生按钮的相对位置的纵坐标加"3"locY += this.btnAdd.Height + 3 ;//创建一个新的Button组件Button myButton = new Button ( ) ;//设定他的名称和Text属性,以及产生的位置myButton.Name = "Button "+ counter ... 阅665 转7 评0 公众公开 06-02-20 15:59 |
如何正确地释放Excel对象?xlbook.Quit() NAR(xlsheet) NAR(xlbook) NAR(xl) GC.Collect() GC.WaitForPendingFinalizers() ......Private Sub NAR(ByRef o As Object) Try System.ReleaseComObject(o) Catch Finally o = Nothing End Try End Sub. 阅763 转12 评0 公众公开 05-11-11 10:43 |
C#排序算法大全。public void Sort(int [] list){int[] iArrary=new int[]{1,5,13,6,10,55,99,2,87,12,34,75,33,47};m<iArrary.Length;m++)Console.Write("{0} ",iArrary[m]);int[] iArrary=new int[]{1,5,3,6,10,55,9,2,87,12,34,75,33,47};插入排序。int[] iArrary=new int[]{1,13,3,6,10,55,98,2,87,12,34,75,3... 阅857 转26 评0 公众公开 05-11-11 10:36 |
BIF_RETURNONLYFSDIRS = 0x0001, // For finding a folder to start document searching BIF_DONTGOBELOWDOMAIN = 0x0002, // For starting the Find Computer BIF_STATUSTEXT = 0x0004, BIF_RETURNFSANCESTORS = 0x0008, BIF_EDITBOX = 0x0010, BIF_VALIDATE = 0x0020, // insist on valid result (or CANCEL)Bool)] internal extern static b... 阅1143 转4 评0 公众公开 05-07-25 15:37 |
3、 变量.ToString() 字符型转换 转为字符串 12345.ToString("n"); //生成 12,345.00 12345.ToString("C"); //生成 ¥12,345.00 12345.ToString("e"); //生成 1.234500e+004 12345.ToString("f4"); //生成 12345.0000 12345.ToString("x"); //生成 3039 (16进制) 12345.ToString("p&qu... 阅986 转12 评0 公众公开 05-07-22 21:00 |
/// <summary> /// 将一段文本加密后保存到一个文件 /// </summary> /// <param name="toEncryptText">要加密的文本数据</param> /// <param name="filePath">要保存的文件</param> /// <param name="IV">初始化向量</param> /// <param name="Key&quo... 阅1104 转9 评0 公众公开 05-07-22 20:59 |
你还可以将自定义的名称添加为“报头信息”,但是这对于PdfWriter没有任何作用,如果看看实例代码0101产生的pdf文件的“文档属性”,我们可以看到仅仅有PDF创建程序和产品日期,而示例代码0106的“文档属性”框中有更多的信息。有有些情况下,你可能希望避免单元格或者整个表被拆分成两个部分,示例代码0511差不多和示例代码0508完全一样,但我... 阅2434 转13 评0 公众公开 05-07-22 20:56 |
public delegate IntPtr NewWndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);public static extern IntPtr SetWindowLong(IntPtr hWnd, int nIndex, NewWndProc wndproc);public static extern IntPtr SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong);public static extern IntPtr CallWindowProc(IntPtr wndProc, In... 阅1598 转5 评0 公众公开 05-07-22 20:56 |
public static string Encode(string data) {byte[] byKey = System.ASCII.GetBytes(KEY_64);byte[] byIV = System.ASCII.GetBytes(IV_64);DESCryptoServiceProvider cryptoProvider = new DESCryptoServiceProvider();MemoryStream ms = new MemoryStream();CryptoStream cst = new CryptoStream(ms,cryptoProvider.ToBase64String(ms.public ... 阅1725 转13 评0 公众公开 05-07-22 20:54 |