Time of Update: 2017-01-19
一、抽象類別中可以提供非抽象的執行方法嗎?介面呢? 答:抽象類別可以這麼寫: 複製代碼 代碼如下:public abstract class A { public string getWebUrl() { return "jb51.net"; } public abstract string getWebName(); } public class B : A { public override string getWebName() { return "雲棲社區"; } } 運行: B b =
Time of Update: 2017-01-19
asp.net如何產生靜態頁,請參考下面的文章:http://www.jb51.net/article/18175.htm而我們用類比的話,只需要讓線程順延強制就可以了。比如下面的代碼: 複製代碼 代碼如下:for (int i = 0; i < 10; i++) { DateTime startTime = DateTime.Now; Response.Write(i + "-------------執行時間:" + startTime.ToString()+"<br />"
Time of Update: 2017-01-19
方案1: 複製代碼 代碼如下:/// <summary > /// 傳入URL返回網頁的html代碼 /// </summary > /// <param name="Url" >URL </param > /// <returns > </returns > public static string getUrltoHtml(string Url) { errorMsg = ""; try {
Time of Update: 2017-01-19
1、ext的grid Ext.grid.CheckboxColumn = function(config){ config.id = config.id || 'ck'; config.columnId = config.id || 'ck'; return Ext.applyIf(config||{},{ init:function(grid){ grid.on('cellclick', this.onCellClick, this);
Time of Update: 2017-01-19
複製代碼 代碼如下:<script language="C#" runat="server"> protected void Page_Load(object sender, System.EventArgs e) { Response.ContentType = "application/x-shockwave-flash"; string fileFlash = Server.MapPath("/") + "1.swf"; System.IO.FileStream
Time of Update: 2017-01-19
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using
Time of Update: 2017-01-19
複製代碼 代碼如下:private static char[] constant = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E',
Time of Update: 2017-01-19
複製代碼 代碼如下:protected void Button1_Click(object sender, EventArgs e) { string filename = this.DropDownList1.SelectedValue;//最終命名 if (this.FileUpload1.PostedFile != null) { string baseFilename = this.FileUpload1.PostedFile.FileName;//擷取上傳檔案檔案名稱 int i =
Time of Update: 2017-01-19
複製代碼 代碼如下:public static void ClearCountByTime() { System.Timers.Timer aTimer = new System.Timers.Timer(); aTimer.Elapsed += new ElapsedEventHandler(TimeEvent); // 設定引發時間的時間間隔 此處設定為1秒 aTimer.Interval = 1000; aTimer.Enabled = true; } private static
Time of Update: 2017-01-19
有關純真IP庫的相關知識:查看( pdf格式) 純真IP庫官方下載地址:http://www.cz88.net/ 使用的類(已經經過調試.net 2.0,已對錯誤做了修改): 複製代碼 代碼如下:using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Text.RegularExpressions; namespace QQWry.NET { public
Time of Update: 2017-01-19
複製代碼 代碼如下:/// <summary> /// 替換html中的特殊字元 /// </summary> /// <param name="theString">需要進行替換的文本。</param> /// <returns>替換完的文本。</returns> public string HtmlEncode(string theString) { theString=theString.Replace(">",
Time of Update: 2017-01-19
複製代碼 代碼如下:isAdmin();因為當時沒有用主版頁面去做,所以不能在主版頁面中統一判斷許可權,而當時我限於自己水平,也沒有採用繼承自Page這個類的方法去統一處理一些頁面載入的時候都要處理的事情。現在根據“李天平(動軟)”的一些代碼記錄下,也希望大家要學會使用繼承啊! 看下一個簡單的繼承自Page的PageBase: 複製代碼 代碼如下:using System; using System.Data; using System.Configuration; using
Time of Update: 2017-01-19
這個問題困惑我好長的時間,在網上搜,也沒完全的解決方案,不是過於簡單,就是亂說,有的論壇上還沒人回答這個問題.今天我徹底解決這個問題,並在C#裡測試完全通過.現在把他寫出來,希望對朋友們有協助(如要轉載,記得給我著作權哦.嘿嘿!!!).以下資訊是綜合網上的資料和我的實際問題,整理出來的. 備份: 在備份按鈕裡寫: 複製代碼 代碼如下:protected void Button1_Click(object sender, EventArgs e) { string path =
Time of Update: 2017-01-19
舉例: 複製代碼 代碼如下:163.com的郵箱在早期申請的是支援的,後面申請的都是不支援。 21cn.com似乎現在已經放棄了smtp支援,可能只有繳費使用者才可以。 qq.com的郵箱需要在使用者帳戶裡面設定。 我拿了個sina.com的郵箱進行測試,也需要在後台裡面的才可以發送。詳細代碼如下:複製代碼 代碼如下:MailAddress from = new MailAddress("sosuo8@sina.com"); MailAddress to = new
Time of Update: 2017-01-19
1、 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { //如果是綁定資料行 if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate) {
Time of Update: 2017-01-19
效果圖:功能: 1、可以有方向鍵上下控制。 2、支援關鍵字高亮。(在該此次代碼中省略) 3、對選中可按斷行符號提交。 使用:重點關注id=tbxsearch和id=search_suggest這兩個東東。html部分涉及到定位的問題,自己處理好,有問題可以提問,細節自己把握。 註明:在接收的那個檔案,其實應該接收一個參數skey的,我先寫死了。記得接收的時候先解碼一次。
Time of Update: 2017-01-19
設定檔,對於程式本身來說,就是基礎和依據,其本質是一個xml檔案,對於設定檔的操作,從.NET 2.0 開始,就非常方便了,提供了 System [.Web] .Configuration 這個管理功能的NameSpace,要使用它,需要添加對 System.configuration.dll的引用。 對於WINFORM程式,使用 System.Configuration.ConfigurationManager; 對於ASP.NET 程式, 使用
Time of Update: 2017-01-19
比如我們要取個日期型的資料,在資料庫中列名是updated,數值是2008/06/01。但是想2008年06月01日這樣顯示,我們可以這樣來寫Bind("updated", "{0:yyyy年MM月dd日}"),Eval也是如此。 2者都能讀取資料中的值,並顯示。當我們使用編輯更新操作時,Bind能夠自動的將修改的值更新到資料庫中,並顯示出修改後的值。但是用了Eval卻只能得到錯誤畫面,新的資料沒有更新到資料庫中。
Time of Update: 2017-01-19
看下這段代碼:產生了這麼多的一段東西,這段東西對seo一點好處也沒有。而我要做的就是去掉它,但有一點,去掉但不能讓它原來的控制項和內容都發生變化,比如說不能使用等等。所以我要做的僅僅是用另一種方式去儲存這些資料。這是一段用base64編碼的資料而並不是加密,我很好奇到底放了些什麼東西在這裡面。下面我開始破解這段代碼。代碼如下:複製代碼 代碼如下:string str =
Time of Update: 2017-01-19
根據使用者需求,在輸入金額時要格式化,即每三位元字加逗號分隔,並保留兩位小數。考慮到使用者的體驗,隨使用JS對金額進行格式化,前台代碼如下:複製代碼 代碼如下:<asp:TextBox ID="txtAmount" runat="server" onkeypress="check()" onkeyup="run(this)"></asp:TextBox>JS代碼如下:複製代碼 代碼如下://======檢查輸入的是否為數字function check() { &