原创 網頁傳遞的參數爲亂碼或不全

修改你的Web.Config:<system.web><globalization responseEncoding = "GB2312" reque

原创 獲取一個類的所有屬性、方法的名字

use reflection:---------------------namespace reflect{using System ;using System.Reflection ; public class ClassA{   pu

原创 byte[]轉換成16進制字符串的高效方法或算法

static char[] hexDigits = {        '0', '1', '2', '3', '4', '5', '6', '7',        '8', '9', 'A', 'B', 'C', 'D', 'E', 'F

原创 在aspx發送前記錄下生成的html

重寫Render:StringBuilder sbPage = new StringBuilder();TextWriter tw = (TextWr

原创 在UserControl中調用所在頁面的ViewState

這樣實現:Page  mypage  =  (Page)System.Web.HttpContext.Current.Handler;  string  s  =  (string)  mypage.ViewState["Whatever

原创 獲取本地主機IP地址

   String strHostName = Dns.GetHostName();   IPHostEntry iphostentry = Dns.

原创 在域控制器中使用默認ASPNET 帳戶時ASP.NET 不能正常運行

在域控制器或備份域控制器上安裝Microsoft Visual Studio .NET 或Microsoft .NET 框架後,如果您嘗試運行 ASP.NET 應用程序,則瀏覽器會顯示下面的錯誤信息: Server Application

原创 停止或開啓系統服務

using System; using System.Management; namespace ArLi.CommonPrj {        public class PLMM007_WMI {               publi

原创 委託(Delegate)

C# 中的委託類似於 C 或 C++ 中的函數指針。使用委託使程序員可以將方法引用封裝在委託對象內。然後可以將該委託對象傳遞給可調用所引用方法的代碼,而不必在編譯時知道將調用哪個方法。與 C 或 C++ 中的函數指針不同,委託是面向對象、

原创 如何使用 Visual C# .NET 檢查 Windows 版本[轉]

獲取 Windows 版本數據獲取 Windows 系統信息判斷平臺判斷 Windows 95, Windows 98, Windows 98 第二版或 Windows Me 的版本判斷 Windows NT, Windows 2000,

原创 文件下載時出現提示框不直接打開

//讀取文件輸出它 string strFile = "c://abc.doc"; FileStream fs = new FileStream(strFile, FileMode.Open); byte[] bytes = new by

原创 如何控制生成的XML中的編碼

如何讓我寫的Xml文件第一行<?xml version="1.0"?>變成我想要的<?xml version="1.0" encoding="utf-8" ?>   ?-------XmlTextWriter writer = new X

原创 aspnet中獲得圖片的大小

System.Drawing.Image   imgPhoto   = System.Drawing.Image.FromFile(Server.MapPath(yourFile)); int sourceWidth  = imgPhot

原创 ASP.NET服務器端異步Web方法

ASP.NET服務器端異步Web方法http://www.microsoft.com/china/msdn/archives/library/dnservice/html/service10012002.asp 點贊

原创 訪問遠程access數據庫總彈出的對話框

---比如有a、b兩臺機子,在a機上有access數據庫,共享在//a//exam//水位.mdb 。 現在在b機編寫程序訪問之。conn = new OleDbConnection();conn.ConnectionString = "