大家可能覺得上面的代碼比較複雜,因為上面對於對列印要求比較高的應用,是十分有效。如果只是單單對資料進行匯出,還可以使用簡單的格式,比如使用以下的代碼: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dt As DataTable = CType(Application.Item("MyDataTable"),
擷取用戶端IP:private string GetClientIP() { string result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (null == result || result == String.Empty) { result = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
我在解決這個問題的時候走了不少彎路,現將方法總結給大家!希望不會有人想我一樣,花了9個小時才弄好。無論是SQL SERVER 2005還是SQL SERVER EXPRESS都可能遇到這個問題。前提:當我在項目的Web.Config檔案中添加<anonymousIdentification enabled="true"/><profile enabled="true"><properties><add name="MyNewProperty"
前幾天寫了兩篇關於URL重寫時,產生靜態頁面的隨筆。利用UrlRewrite,asp.net動態產生htm頁面 利用UrlRewrite,asp.net動態產生htm頁面(補充說明)今天把原來的思路給整理了一下,原來需要兩個類(ModuleRewriter和CreateHtmFactoryHandler)才能完成整個過程,現在只用ModuleRewriter就可以了,我畫了個流程圖關鍵類ModuleRewriter代碼CodeCode highlighting produced by
【原文地址】Tip/Trick: Cool UI Templating Technique to use with ASP.NET AJAX for non-UpdatePanel scenarios 【原文發表日期】 Sunday, October 22, 2006 9:02 PM這個周末我一直饒有興趣地在玩ASP.NET AJAX Beta版。通常情形下,當我把AJAX功能整合進我的編碼時,我最後總是使用 ASP.NET AJAX
public static int Asc(string character) { if (character.Length == 1) { System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding(); int intAsciiCode = (int)asciiEncoding.GetBytes(character)[0]; return (intAsciiCode); }