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

ASP Encode/Decode Functions

http://www.aspnut.com/reference/encoding.asp
Server.URLEncode
Used for encoding data that will be passed via a querystring variable. A querystring variable is anything following the question mark (?) in the URL (location) field of your browser. You create querystring variables when you perform a redirect or build a hyperlink to another page on your site.
<a href="page2.asp?name=Joe+Schmoe">here</a>
<%
Response.Redirect "page2.asp?ID=3"
%>
In the example above, the hyperlink contains a variable named "name" which has a value of "Joe Schmoe" (the space is encoded as "+") In the Response.Redirect statement, we have a querystring variabled named "ID" with a value of 3. To perform a URL encode on a variable (for purposes of passing this variable to another page) use the following:
<a href="page2.asp?name=<%= Server.URLEncode(sName) %>">
here</a>
<%
Response.Redirect "page2.asp?ID=" &_
Server.URLEncode(nID)
%>
URLDecode
For some reason, Microsoft did not include a URL decode function with Active Server Pages. Most likely, this was because the decoding of querystring variables is done automatically for you when you access the querystring object:
<%= Request.QueryString("name") %>

For those of you who are desperately in need of this function:
' -----------------------------------------
' URL decode to retrieve the original value
Function URLDecode(sConvert)
Dim aSplit
Dim sOutput
Dim I
If IsNull(sConvert) Then
URLDecode = ""
Exit Function
End If

' convert all pluses to spaces
sOutput = REPLACE(sConvert, "+", " ")

' next convert %hexdigits to the character
aSplit = Split(sOutput, "%")

If IsArray(aSplit) Then
sOutput = aSplit(0)
For I = 0 to UBound(aSplit) - 1
sOutput = sOutput & _
Chr("&H" & Left(aSplit(i + 1), 2)) &_
Right(aSplit(i + 1), Len(aSplit(i + 1)) -


Ïà¹ØÎĵµ£º

×Ô¼ºÊÕ¼¯µÄ¸÷ÖÖASPµÄÑéÖ¤Âë

ÓÉÓÚÏîÄ¿µÄÐèҪȥGoogleËÑÁËһϠ£¬»¹Õæ¶à
¼ÇµÃ“Ïëµ±Äê”ijÌìÉÏÎçÔÚÕâÀï·¹ý£¬¿´µ½Ò»Î»ÅóÓÑÌùµÄ×Ô¼ºÐ´µÄÑéÖ¤Âë³ÌÐò£¬ËäÈ»ËûµÄ³ÌÐòÊǺڰ×ÓÐÔӵ㣬µ«ÆäʵºÜÈÝÒ×±»ÆÆ½âµÄ£¬µ«È´Óв»ÉÙÈËϲ»¶×Å¡£¡£¡£Ã»°ì·¨£¬µ±ÌìÏÂÎçÑо¿ÁËÒ»·­ BMP ͼƬ£¬È»ºó¾Íд³öÁËÕâЩ´úÂ룬ֻÊǵ±³õûÓй«²¼£¬ÑÛ¿´½ñÌìÕâô¶à»µÈËÂÒÔںܶàÂÛ̳ ......

asp to html

<!--#include file="inc/conn.asp" -->
<%
openconn()
sql="select * from tbnews"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
id=rs("id")
%>
<%
do while not rs.eof
%>
<%
Do_Url = "http://"
'Do_Url = Do_Url&Request.ServerVariables("SERVER_NAME ......

aspÁ¬½Ómysql

ÒÔmysql5.1ΪÀý
ÏÈÏÂÔØmysql-connector-odbc²¢°²×°
1¡¢Ö±½ÓÁ¬½Ó
conn.asp
<%
strconnection="driver={mysql odbc 5.1 driver};database=test1;server=localhost;uid=root;password=root"
set conn = server.createobject("adodb.connection")
conn.open strconnection
%>
2¡¢DSNÁ¬½Ó
ÐèÒªÏÈÔÚÊý¾ÝÔ´ (OD ......

ASP.NET ÔÚ ASP.NET ÍøÒ³ÖÐÑéÖ¤Óû§ÊäÈë

 
      ͨ¹ýʹÓÃÑéÖ¤¿Ø¼þ£¬¿ÉÒÔÏò ASP.NET ÍøÒ³ÖÐÌí¼ÓÊäÈëÑéÖ¤¡£ÑéÖ¤¿Ø¼þΪËùÓг£Óõıê×¼ÑéÖ¤ÀàÐÍ£¨ÀýÈ磬²âÊÔij·¶Î§ÄÚµÄÓÐЧÈÕÆÚ»òÖµ£©ÌṩÁËÒ»ÖÖÒ×ÓÚʹÓõĻúÖÆ£¬ÒÔ¼°×Ô¶¨Òå±àдÑéÖ¤µÄ·½·¨¡£´ËÍ⣬ÑéÖ¤¿Ø¼þ»¹ÔÊÐí×Ô¶¨ÒåÏòÓû§ÏÔʾ´íÎóÐÅÏ¢µÄ·½·¨¡£ÑéÖ¤¿Ø¼þ¿ÉÓë ASP.NET ÍøÒ³ÉϵÄÈκοؼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ