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")) '取得当前地址
相关文档:
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
......
现象:普通的html文字显示正常,但用response.write等asp代码输出的文字就出现乱码
解决方法:起初以为是浏览器编码出错的原因,所有在代码中加入
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
但还是出现乱码,问题没解决,上面的代码指定的是html静态文字的编码
最后查资料反省是c ......
由于项目的需要去Google搜了一下 ,还真多
记得“想当年”某天上午在这里路过,看到一位朋友贴的自己写的验证码程序,虽然他的程序是黑白有杂点,但其实很容易被破解的,但却有不少人喜欢着。。。没办法,当天下午研究了一翻 BMP 图片,然后就写出了这些代码,只是当初没有公布,眼看今天这么多坏人乱在很多论坛 ......
1) Delphi向oracle中传递参数 如oracle中的参数名为erpcx
答:如果想从表里取值到oracle,则erpcx:=trim(aq1.fieldbyname('erpcx').AsString);
否则直接用控件名字
语句为
with aperp do
begin
connection:=dm.ADOCerp;
parameters.Clear;&nbs ......