易截截图软件、单文件、免安装、纯绿色、仅160KB

asp获取URL的方法

方法一:简单,得不到参数,只有一个虚拟路径
GetUrl =request("url")
例如:http://127.0.0.1/shiyan.asp?dfsdfsf=dsfsdfd&aa=dddd
获取为:shiyan.asp
方法二:得到整个URL,得到参数
'得到当前页面的地址    
Function   GetUrl()    
On   Error   Resume   Next    
Dim   strTemp    
If   LCase(Request.ServerVariables("HTTPS"))   =   "off"   Then    
strTemp   =   "http://"    
Else    
strTemp   =   "https://"    
End   If    
strTemp   =   strTemp   &   Request.ServerVariables("SERVER_NAME")    
If   Request.ServerVariables("SERVER_PORT")   <>   80   Then   strTemp   =   strTemp   &   ":"   &   Request.ServerVariables("SERVER_PORT")    
strTemp   =   strTemp   &   Request.ServerVariables("URL")    
If   Trim(Request.QueryString)   <>   ""   Then   strTemp   =   strTemp   &   "?"   &   Trim(Request.QueryString)    
GetUrl   =   strTemp    
End   Function    
例如:http://127.0.0.1/shiyan.asp?dfsdfsf=dsfsdfd&aa=dddd
获取为:http://127.0.0.1/shiyan.asp?dfsdfsf=dsfsdfd&aa=dddd
方法二:得到虚拟路径,得到参数
Private Function GetUrl()
Dim ScriptAddress,M_ItemUrl,M_item
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME")) '取得当前地址


相关文档:

asp上传类

 1.UpLoadClass.asp
<%
Class UpLoadClass
Private p_MaxSize,p_FileType,p_SavePath,p_AutoSave,p_Error
Private objForm,binForm,binItem,strDate,lngTime
Public FormItem,FileItem
Public Property Get Version
Version=""
End Property
......

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读取XML文件

<%
'
Set http=Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET","http://127.0.0.1/1.xml",False
http.send
Dim xml
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
'xml.load (Server.MapPath("1.xml")) '如果不是远程文件直接这一步
xml.Load(http.ResponseXML)
Dim t ......

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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号