摘要:
在ASP.NET应用中,Web表单之间的导航有多种方式:用超级链接,用Response.Redirect,用Server.Transfer,或者用Server.Execute。本文将分析这四种导航方式的异同及其优缺点,帮助你选择最佳的导航方式。 一、超级链接 从一个表单进入另一个表单最简单的方式是使用HTML超级链接控件。在Web表单中,使用超级链接的HTML代码类如: <a hr... 阅读全文
摘要:
usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.We... 阅读全文
摘要:
public static string Intercept(string input, int p) { Encoding encode = Encoding.GetEncoding("gb2312"); byte[] byteArr = encode.GetBytes(input); if (byteArr.Length <= p) return input; int m = 0, n ... 阅读全文
摘要:
using System;using System.Collections;using System.Configuration;using System.Data;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.W... 阅读全文
摘要:
用SQL2005的row_number()做的分页,表上建1个聚集索引、三个非聚集索引、两个全文索引。 从1000万条记录中按特定条件提取1~200条,耗时在3秒以内。平均60个并发用户请求。 语句A: Select*FROM (SelectROW_NUMBER()OVER(ORDERBY[id]ASC)ASRowNum,*FROMtable)AST WhereRowNumBETWEENXANDY... 阅读全文
摘要:
很多人不知道SQL语句在SQLSERVER中是如何执行的,他们担心自己所写的SQL语句会被SQLSERVER误解。比如: select*fromtable1wherename='zhangsan'andtID>10000 和执行: select*fromtable1wheretID>10000andname='zhangsan' 一些人不知道以上两条语句的执行效率是否一样,因为如... 阅读全文
摘要:
1--从Table表中取出第m条到第n条的记录:(NotIn版本) 2 3SelectTOPn-m+1* 4FROMTable 5Where(idNOTIN(SelectTOPm-1idFROMTable)) 6 7 8--从TABLE表中取出第m到n条记录(Exists版本) 9 10SelectTOPn-m+1*FROMTABLEASaWhereNotExists 11(Select*From... 阅读全文
摘要:
网上收集的;收藏一下;public class XmlControl{protected string strXmlFile;protected XmlDocument objXmlDoc = new XmlDocument();public XmlControl(string XmlFile){//// TODO: 在这里加入建构函式的程序代码//try{objXmlDoc.Load(XmlFi... 阅读全文
摘要:
显示效果: 2007年2月28日星期三农历丁亥年正月十一 BLOG日历下面的农历是用以下内容经过处理的; <SCRIPTlanguage=JavaScript> functionRunGLNL(){ vartoday=newDate(); vard=newArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); varDDDD=(today.g... 阅读全文
摘要:
usingSystem; usingSystem.IO; namespace查看文件和子目录项目 { ///<summary> ///Class1的摘要说明。 ///</summary> classExploreFile { staticintdirCounter=1; staticintindentLevel=-1; staticintfileCounter=0; ///... 阅读全文
摘要:
方法A: usingSystem; usingSystem.Data; usingSystem.Configuration; usingSystem.Collections; usingSystem.Web; usingSystem.Web.Security; usingSystem.Web.UI; usingSystem.Web.UI.WebControls; usingSystem.Web.U... 阅读全文
摘要:
Default.aspx <%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"%> <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD... 阅读全文
摘要:
通过WebRequest创建一个请求后,你可以通过请求来获取HttpWebResponse。通过HttpWebResponse.StatusCode来判断当前错误,也可以得到一些精确的消息。代码详细列表:成员名称说明Continue等效于 HTTP 状态 100。Continue 指示客户端可能继续其请求。SwitchingProtocols等效于 HTTP 状态 101。SwitchingPro... 阅读全文
摘要:
privatestringGetClientIP() { stringresult=HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if(null==result||result==String.Empty) { result=HttpContext.Current.Request.ServerVariabl... 阅读全文
摘要:
usingSystem; usingSystem.IO; usingSystem.Text; usingSystem.Data; namespaceDbConvert { /********************************************************************************** * *功能说明:文件*作类 *作者: *版本: * ***... 阅读全文
摘要:
privateDateTimestartTime; privatevoidPage_Init(Objectsender,EventArgse) { startTime=DateTime.Now; } protectedoverridevoidRender(HtmlTextWriterwriter) { base.Render(writer); DateTimeendTime=DateTime.N... 阅读全文
摘要:
stringPageUrl="http://www.163.com/"; System.Net.HttpWebRequestrequest=(System.Net.HttpWebRequest)System.Net.WebRequest.Create(PageUrl); request.UserAgent="Mozilla/4.0(compatible;MSIE7.0;Window... 阅读全文
摘要:
方法一: privatereadonlystring_NumChinese="零壹贰叁肆伍陆柒捌玖"; privatereadonlystring_UnitChinese="仟佰拾亿仟佰拾万仟佰拾圆角分"; ///<summary> ///小写金额转化成大写金额(只支持精确到分的小写金额) ///</summary> ///<returns></retur... 阅读全文
摘要:
前台: <asp:LabelID="Label1"runat="server"Text="Label"></asp:Label> <asp:LabelID="ShowPageNumber"Font-Size="14px"runat="server"></asp:Label> 源码: protectedvoidPage_Load(objectsende... 阅读全文