怎么对路径进行加密?

selectfrom 2005-04-13 09:23:55
怎么在地址栏中对路径进行加密?加密后还是一样正常的访问。
...全文
289 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
meizz 2005-04-13
  • 打赏
  • 举报
回复
使用隐藏框架, 地址栏中的地址永远不变, 不与当前操作的页面对应
selectfrom 2005-04-13
  • 打赏
  • 举报
回复
艾,还是搞不定,可不可以给个简单的。。呵呵,
baikaishui_0825 2005-04-13
  • 打赏
  • 举报
回复
大概就这样
<%
url=URLDecode(request("url"))
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
'把下面的地址替换成你的首页的文件地址,一定要用http://开头的绝对路径,不能写相对路径
xml.Open "GET", url,False
xml.Send
BodyText=xml.ResponseBody
BodyText=BytesToBstr(BodyText,"gb2312")
Set xml = Nothing
response.write(BodyText)


Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function URLEncode(strInput )
Dim strOutput
Dim intAscii
Dim i


For i = 1 To Len(strInput)
intAscii = Asc(Mid(strInput, i, 1))
If ((intAscii < 58) And (intAscii > 47)) Or((intAscii < 91) And (intAscii > 64)) Or ((intAscii < 123) And (intAscii > 96)) Then
strOutput = strOutput & Chr(intAscii)
Else
if intAscii<16 then
strOutput=strOutput&"%0"&Trim(Hex(intAscii))
else
strOutput=strOutput&"%"&Trim(Hex(intAscii))
end if
End If
Next
URLEncode = strOutput
End Function

Function URLDecode(enStr)
dim deStr
dim c,i,v
deStr=""
for i=1 to len(enStr)
c=Mid(enStr,i,1)
if c="%" then
v=eval("&h"+Mid(enStr,i+1,2))
if v<128 then
deStr=deStr&chr(v)
i=i+2
else
if isvalidhex(mid(enstr,i,3)) then
if isvalidhex(mid(enstr,i+3,3)) then
v=eval("&h"+Mid(enStr,i+1,2)+Mid(enStr,i+4,2))
deStr=deStr&chr(v)
i=i+5
else
v=eval("&h"+Mid(enStr,i+1,2)+cstr(hex(asc(Mid(enStr,i+3,1)))))
deStr=deStr&chr(v)
i=i+3
end if
else
destr=destr&c
end if
end if
else
if c="+" then
deStr=deStr&" "
else
deStr=deStr&c
end if
end if
next
URLDecode=deStr
end function

function isvalidhex(str)
isvalidhex=true
str=ucase(str)
if len(str)<>3 then isvalidhex=false:exit function
if left(str,1)<>"%" then isvalidhex=false:exit function
c=mid(str,2,1)
if not (((c>="0") and (c<="9")) or ((c>="A") and (c<="Z"))) then isvalidhex=false:exit function
c=mid(str,3,1)
if not (((c>="0") and (c<="9")) or ((c>="A") and (c<="Z"))) then isvalidhex=false:exit function
end function


%>


selectfrom 2005-04-13
  • 打赏
  • 举报
回复
对URL处理,我会的。
http://www.abc.com?url=http%3A%2F%2Fwww%2Emicrosoft%2Ecom
这样的也好,但是我提交过去都是找不到我想要的页面,
gaoan 2005-04-13
  • 打赏
  • 举报
回复
热切关注这个问题的解决。....

本人也遇到了这个问题,很着急.
baikaishui_0825 2005-04-13
  • 打赏
  • 举报
回复
很难达到isapi_rewrite的功能
用URLEncode
http://www.abc.com?url=http%3A%2F%2Fwww%2Emicrosoft%2Ecom
这样的加密是可以的,但你要经过url处理的
selectfrom 2005-04-13
  • 打赏
  • 举报
回复
在没有服务器的情况下,怎么才能实现这功能呢?是否给个例子,谢谢
baikaishui_0825 2005-04-13
  • 打赏
  • 举报
回复
是的isapi_rewrite是有服务器的来说
现在有些空间服务器商也提供这个了
selectfrom 2005-04-13
  • 打赏
  • 举报
回复
baikaishui_0825(baikaishui) 这个是否写得清楚点看不懂
isapi_rewrite
这个好像是对有服务器的来说的吧,我要传到空间上的。
baikaishui_0825 2005-04-13
  • 打赏
  • 举报
回复
还有用isapi_rewrite
baikaishui_0825 2005-04-13
  • 打赏
  • 举报
回复
URLEncode
The URLEncode method applies URL encoding rules, including escape characters, to a specified string.

Syntax
Server.URLEncode( string )

Parameters
string
Specifies the string to encode.
Example
The following script

<%Response.Write(Server.URLEncode("http://www.microsoft.com")) %>

produces the output

http%3A%2F%2Fwww%2Emicrosoft%2Ecom

xumw 2005-04-13
  • 打赏
  • 举报
回复
唉………………
那禁止右键不就行了。
onlytiancai 2005-04-13
  • 打赏
  • 举报
回复
右键点属性还是可以查到呀,可以用ISAPI来映射路径,隐藏真实路径,给查询字符串加密,用IHTTPMODUL等来解决

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧