Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

[ת]asp.netÇø·ÖÖÐÓ¢ÎÄ×Ö·û´®½ØÈ¡

/// <summary>
/// ×Ö·û´®Çиî
/// </summary>
/// <param name="p_SrcString"></param>
/// <param name="p_Length"></param>
/// <returns></returns>
public static string GetSubString(string p_SrcString, int p_Length)
{
string myResult = p_SrcString;
if (p_Length >= 0)
{
byte[] bsSrcString = System.Text.Encoding.GetEncoding("GB2312").GetBytes(p_SrcString);
if (bsSrcString.Length >= p_Length)
{
int nRealLength = p_Length;
int[] anResultFlag = new int[p_Length];
byte[] bsResult = null;
int nFlag = 0;
for (int i = 0; i < p_Length; i++)
{
if (bsSrcString[i] > 127)
{
nFlag++;
if (nFlag == 3)
nFlag = 1;
}
else
nFlag = 0;
anResultFlag[i] = nFlag;
}
if ((bsSrcString[p_Length - 1] > 127) && (anResultFlag[p_Length - 1] == 1))
nRealLength = p_Length + 1;
bsResult = new byte[nRealLength];
Array.Copy(bsSrcString, bsResult, nRealLength);
myResult = System.Text.Encoding.GetEncoding("GB2312").GetString(bsResult) + "...";
}
}
return myResult;
}


Ïà¹ØÎĵµ£º

ASP.NET ÎļþÏÂÔØ

ÏÂÔØÒ³Ãæ£º
 <a href="download.ashx?url=<%=Server.UrlEncode("˵Ã÷.txt")%>">ÏÂÔØ</a>
------------------------------------------------------------------------------
download.ashx
<%@ WebHandler Language="C#" Class="download" %>
using System;
using System.Web;
public ......

ASP.NET Ò³ÃæÖ¸Áî Ö® @OutputCache

»º´æµÄÖØÒªÐԾͲ»ÓÃÔÙÇ¿µ÷ÁË£¬@OutputCache¸øÎÒÃÇÌṩÁËÒ»ÖÖÉùÃ÷µÄ·½Ê½(¶ÔÓ¦µÄ»¹Óбà³ÌµÄ·½Ê½)À´¿ØÖÆÒ³ÃæºÍÓû§¿Ø¼þµÄ»º´æ²ßÂÔ£¬ÕâÊÇÒ»ÖÖ×î¼òµ¥Ö±½ÓµÄÍøÕ¾ÓÅ»¯·½Ê½¡£
»¹ÊÇÏÈÀ´¹ýÒ»±é@OutpuCacheËùÓеÄÊôÐÔ£¬¹²ÓÃ11¸öÊôÐÔ£¬Õâ¸öÖ¸Áî¿ÉÒÔÓÃÓÚÒ³Ãæ(.aspx)ºÍÓû§¿Ø¼þ(.ascx)
ÊôÐÔ
Duration
Ò³»òÓû§¿Ø¼þ½øÐлº´æµÄʱ¼ä£¬µ¥Î ......

asp.net¿Í»§¶Ë´«µÝ²ÎÊýÐĵÃ

 
¿Í»§¶Ë´«ËÍÊý¾Ýµ½·þÎñÆ÷¶ËÓÐÈýÖÖ·½·¨£º
1.form
2.querystring
3.cookie
ÀûÓÃÕâЩ·½Ê½È¡µÃµÄÊý¾ÝÔÚ·þÎñÆ÷¶Ë¶¼ÊÇ×ֵ伯ºÏ,Èç¹ûÒª¾«È·È¡µ½Ä³¸ö¼¯ºÏµÄÖµ£¬ÔòÖ±½ÓʹÓöÔÓ¦µÄ¼¯ºÏµÄÃû³Æ£¬ÈýÖÖ·½Ê½¶ÔÓ¦µÄ¼¯ºÏÈçÏ£º
1.form:request.form
2.querystring:request.querystring
3.cookie:request.cookie
ÀûÓÃrequest.p ......

ASP.NETÒ³ÃæË¢Ð·½·¨×ܽá

µÚÒ»£º
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); } µÚ¶þ£º
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.location.href=document.URL; < /script&g ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ