Time of Update: 2018-12-08
複製代碼 代碼如下:public class SqlOperation { #region 屬性 /// <summary> /// 儲存在Web.config中的連接字串 /// </summary> protected static string connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["hao"].ConnectionString; /// <
Time of Update: 2018-12-08
我們暫且不說如何去類比資料,通過一個簡單的form看看當請求發生時,用戶端提交了什麼樣的資料給服務端。 下面是一個簡單的html form,兩個文本輸入框,一個檔案上傳(這裡我選擇一張圖片),注意有檔案上傳的form的enctype屬性。 複製代碼 代碼如下:<form action="sql.aspx" method="post" enctype="multipart/form-data"> <input id="Text1" name="content"
Time of Update: 2018-12-08
1.作業環境 開發環境:vs2005 /vs2008資料庫:sql2005 excel:2003首先在vs加入com組件(當然也可以加入.net下的excel組件):之後vs引用子目錄會多出下面三個dll: 簡單操作流程如下:複製代碼 代碼如下:using Excel; // from bill example public void writeExcelAdvance(String outputFile) { string[,] myData = { { "車牌號", "類型", "品 牌"
Time of Update: 2018-12-08
分頁方法 複製代碼 代碼如下:/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="replist">控制項ID</param> /// <param name="DataSource">資料來源</param> /// <param
Time of Update: 2018-12-08
例如:文本abcaBcabCaBCabcaBCa,關鍵字bc,在不區分大小寫情況,一共有6個匹配項。 則在網頁中顯示的是abcaBcabCaBCabcaBCa。 很多人,想到是replace函數。原型為 Replace(string,find,replacewith[,start[,count[,compare]]]) string 必選項,字串運算式,包含要替代的子字串 find 必選項,被搜尋的子字串
Time of Update: 2018-12-08
1.字串轉位元組 string content="這是做個測試!"; System.Text.UnicodeEncoding converter = new System.Text.UnicodeEncoding(); byte[] byteArr = converter.GetBytes(content); 2.位元組轉為字串 複製代碼 代碼如下:System.Text.UnicodeEncoding converter = new System.Text.UnicodeEncoding();
Time of Update: 2018-12-08
一般的單項資料選擇可以使用DropdownList控制項來實現,但對於有多個選擇性輸入,而且輸入有層次關係的內容,最好選擇TreeView控制項來實現。本文介紹如何使用使用TreeView控制項來有效擷取使用者的輸入,其中涉及到TreeView控制項的級聯選擇、去掉節點HTML連結變為展開目錄、擷取選擇內容、如何構造資料庫的資訊變為樹形內容以及快顯視窗使用等知識點,本文輸入應用層級的例子,希望能做個記號,對己對人,皆為利好!^_^本文的經營範圍是一個可以輸入分類及詳細子內容的,由於內容繁多,而且
Time of Update: 2018-12-08
複製代碼 代碼如下:/// <summary> /// TextBox的最大長度驗證器,如果是varchar,char欄位類型,需要此驗證 /// </summary> [Description("對MaxLength進行驗證")] [ToolboxData("<{0}:MaxLengthValidator runat=server></{0}:MaxLengthValidator>")] public class
Time of Update: 2018-12-08
本次工作內容是要將以下資料解析成.Net可以使用的資料,返回的資料除了header,其他的都是可變的,也就是說結構不是固定的。完全由使用者選擇,所以選擇了產生DataTable。 Json資料格式如下: 複製代碼 代碼如下:{"dataSet":{ "header":{ "returnCode":"0", "errorInfo":"HTTP請求錯誤", "version":"V1.0R010", "totalRows":"2000", "returnRows":"20" },
Time of Update: 2018-12-08
先說一下我的測試環境:XPSP2,IIS5.1,FCKeditor2.0 在IIS上建立一個新的網站,我直接取名為FCKeditor 在DW裡建立一個相對應的網站,測試伺服器為本機,支援VBScript 下載FCKeditor2.0,這個東西是開源的,網上能下到的地方很多,自己找去…… 下載下來的應該是壓縮包,解壓到FCKeditor網站根目錄,什麼都不需要更改,直接就可以開始調用了。等你會了的時候,會發現簡單得要死去!
Time of Update: 2018-12-08
複製代碼 代碼如下:Class XMLClass Private objXml Private xmlDoc Private xmlPath '//============================================================ ' Sub Class_initialize Set objXml = Server.CreateObject("MSXML2.DOMDocument") objXml.preserveWhiteSpace = true
Time of Update: 2018-12-08
目錄 一、 環境配置 二、 ASP對Excel的基本操作 三、 ASP操作Excel產生資料表 四、 ASP操作Excel產生Chart圖 五、 伺服器端Excel檔案瀏覽、下載、刪除方案 六、 附錄 本文 一、 環境配置 伺服器端的環境配置從參考資料上看,微軟系列的配置應該都行,即: 1.Win9x+PWS+Office 2.Win2000 Professional+PWS+Office 3.Win2000 Server+IIS+Office
Time of Update: 2018-12-08
ADO對象: Connection Command Recordset Record Stream ASP支援的對象很多,可以自己編寫COM組件,下面是我們經常使用的: Server.CreateObject("scripting.filesystemobject") Server.CreateObject("scripting.dictionary")hashtable server.createxobject("word.Application")//server
Time of Update: 2018-12-08
具體辦法如下:可以通過自訂頁面基類,重寫預設的HtmlTextWriter方法,重寫屬性輸出WriteAttribute(string name, string value, bool encode)方法,當輸出action時,將action屬性的值強制轉換為當前虛URL(HttpContext.Current.Request.RawUrl,上面的~/showVisasAll_(\w+)\.aspx) 最後就是讓所有的頁面都調用這個基類,修改一下Web.config就好了 <!--
Time of Update: 2018-12-08
資料庫結構: classidid 主鍵 jobClassName 對應的類型名稱 ClassName 對應的父類的id 通常做法: 複製代碼 代碼如下:private void Display(string parentid, String space) { DataTable dt; String strSQL; strSQL = "Select * From Tree Where ParentID =" + parentid + " Order By ClassID DESC";
Time of Update: 2018-12-08
首先我們建立一個網站,在網站裡面新增一般處理常式,命名為ReadData.ashx。然後在裡面輸入如下代碼: 複製代碼 代碼如下:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Data.SqlClient; //引入命名空間 using System.Data; namespace 載入層 {
Time of Update: 2018-12-08
主要步驟如下: 1,在asp.net mvc項目中引入jqrte類庫,聲明輔助類用於儲存伺服器端上傳檔案的資訊 複製代碼 代碼如下:public class ViewDataUploadFilesResult { public string message { get; set; } //public int Length { get; set; } public string imagepath { get; set; } public string error { get; set; } }
Time of Update: 2018-12-08
在新增資料項目的時候,用ajax實現無重新整理提交,但上傳檔案的時候,由於資料類型原因,不能將頁面的<asp:FileUpload>中以字串值的方式傳到js裡調用。我一共找到了兩個方法予以解決,實現無重新整理上傳。
Time of Update: 2018-12-08
複製代碼 代碼如下:using System; using System.Configuration; using System.Data; using System.Data.OleDb; using System.Xml; using System.Collections; namespace Website.Command { /// <summary> /// WSplus 的摘要說明。 /// </summary> public class
Time of Update: 2018-12-08
在後台添加中一般我們都設定了一個“關鍵字”,而且一般輸入可能如下: 娃娃,毛絨娃娃,日本充氣娃娃 我們將根據這個來做,具體實現如下: 先看一條SQL語句: 複製代碼 代碼如下:select top 3 sid,sname from product where keywords like '%娃娃%' or keywords like '%毛絨娃娃%' or keywords like '%日本充氣娃娃%'