如何实现一个超级链接只能在通过点击超级链接才可以下载文件,而通过FLASHGET之类的工具不能下载啊?

Cell 2004-09-24 11:27:34
如何实现一个文件下载的超级链接只能在通过点击超级链接才可以下载文件,而通过FLASHGET之类的工具不能下载啊?
...全文
149 点赞 收藏 4
写回复
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
iuhxq 2004-11-29
<%
function dl(f,n)
on error resume next

set s=CreateObject("Adodb.Stream")
S.Mode=3
S.Type=1
S.Open
s.LoadFromFile(server.mappath(f))
response.contentType="application/x-gzip"
response.addheader "Content-Disposition:","attachment; filename=" & n
response.binarywrite(s.Read(s.size))
end function

call dl(request("file"),request("file"))
%>


用flashget下载http://www.ccopus.com/code/serverVariables.asp的代码:

8 ServerVariables变量列表 :::... Coding by Sunrise_Chen.

变量名 值
ALL_HTTP HTTP_ACCEPT:*/*
HTTP_CONNECTION:close
HTTP_HOST:www.ccopus.com
HTTP_REFERER:http://www.ccopus.com/code
HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)
HTTP_PRAGMA:no-cache
HTTP_COOKIE:cc_7_return_site_cocoon=1
HTTP_CACHE_CONTROL:no-cache
HTTP_X_REWRITE_URL:/code/serverVariables.asp

ALL_RAW Accept: */*
Connection: close
Host: www.ccopus.com
Referer: http://www.ccopus.com/code
User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)
Pragma: no-cache
Cookie: cc_7_return_site_cocoon=1
Cache-Control: no-cache
X-Rewrite-URL: /code/serverVariables.asp

APPL_MD_PATH /LM/W3SVC/3/Root
APPL_PHYSICAL_PATH F:\Sunrise_Chen\
AUTH_PASSWORD
AUTH_TYPE
AUTH_USER
CERT_COOKIE
CERT_FLAGS
CERT_ISSUER
CERT_KEYSIZE
CERT_SECRETKEYSIZE
CERT_SERIALNUMBER
CERT_SERVER_ISSUER
CERT_SERVER_SUBJECT
CERT_SUBJECT
CONTENT_LENGTH 0
CONTENT_TYPE
GATEWAY_INTERFACE CGI/1.1
HTTPS off
HTTPS_KEYSIZE
HTTPS_SECRETKEYSIZE
HTTPS_SERVER_ISSUER
HTTPS_SERVER_SUBJECT
INSTANCE_ID 3
INSTANCE_META_PATH /LM/W3SVC/3
LOCAL_ADDR 61.129.88.181
LOGON_USER
PATH_INFO /code/serverVariables.asp
PATH_TRANSLATED F:\Sunrise_Chen\code\serverVariables.asp
QUERY_STRING
REMOTE_ADDR 218.108.181.58
REMOTE_HOST 218.108.181.58
REMOTE_USER
REQUEST_METHOD GET
SCRIPT_NAME /code/serverVariables.asp
SERVER_NAME www.ccopus.com
SERVER_PORT 80
SERVER_PORT_SECURE 0
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/5.0
URL /code/serverVariables.asp
HTTP_ACCEPT */*
HTTP_CONNECTION close
HTTP_HOST www.ccopus.com
HTTP_REFERER http://www.ccopus.com/code
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)
HTTP_PRAGMA no-cache
HTTP_COOKIE cc_7_return_site_cocoon=1
HTTP_CACHE_CONTROL no-cache
HTTP_X_REWRITE_URL /code/serverVariables.asp

正常浏览的代码:
8 ServerVariables变量列表 :::... Coding by Sunrise_Chen.

变量名 值
ALL_HTTP HTTP_ACCEPT:*/*
HTTP_ACCEPT_LANGUAGE:zh-cn
HTTP_CONNECTION:Keep-Alive
HTTP_HOST:www.ccopus.com
HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Maxthon; .NET CLR 1.1.4322)
HTTP_COOKIE:cc_7_visited_site_cocoon=2; cc_7_return_site_cocoon=2; ASPSESSIONIDQQSQRSCB=ANGMJHGBGCMJJLDNKAIBIIAI; cc_7_visited_site_cocoon=1; cc_7_return_site_cocoon=1
HTTP_ACCEPT_ENCODING:gzip, deflate
HTTP_X_REWRITE_URL:/code/serverVariables.asp

ALL_RAW Accept: */*
Accept-Language: zh-cn
Connection: Keep-Alive
Host: www.ccopus.com
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Maxthon; .NET CLR 1.1.4322)
Cookie: cc_7_visited_site_cocoon=2; cc_7_return_site_cocoon=2; ASPSESSIONIDQQSQRSCB=ANGMJHGBGCMJJLDNKAIBIIAI; cc_7_visited_site_cocoon=1; cc_7_return_site_cocoon=1
Accept-Encoding: gzip, deflate
X-Rewrite-URL: /code/serverVariables.asp

APPL_MD_PATH /LM/W3SVC/3/Root
APPL_PHYSICAL_PATH F:\Sunrise_Chen\
AUTH_PASSWORD
AUTH_TYPE
AUTH_USER
CERT_COOKIE
CERT_FLAGS
CERT_ISSUER
CERT_KEYSIZE
CERT_SECRETKEYSIZE
CERT_SERIALNUMBER
CERT_SERVER_ISSUER
CERT_SERVER_SUBJECT
CERT_SUBJECT
CONTENT_LENGTH 0
CONTENT_TYPE
GATEWAY_INTERFACE CGI/1.1
HTTPS off
HTTPS_KEYSIZE
HTTPS_SECRETKEYSIZE
HTTPS_SERVER_ISSUER
HTTPS_SERVER_SUBJECT
INSTANCE_ID 3
INSTANCE_META_PATH /LM/W3SVC/3
LOCAL_ADDR 61.129.88.181
LOGON_USER
PATH_INFO /code/serverVariables.asp
PATH_TRANSLATED F:\Sunrise_Chen\code\serverVariables.asp
QUERY_STRING
REMOTE_ADDR 218.108.181.58
REMOTE_HOST 218.108.181.58
REMOTE_USER
REQUEST_METHOD GET
SCRIPT_NAME /code/serverVariables.asp
SERVER_NAME www.ccopus.com
SERVER_PORT 80
SERVER_PORT_SECURE 0
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/5.0
URL /code/serverVariables.asp
HTTP_ACCEPT */*
HTTP_ACCEPT_LANGUAGE zh-cn
HTTP_CONNECTION Keep-Alive
HTTP_HOST www.ccopus.com
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Maxthon; .NET CLR 1.1.4322)
HTTP_COOKIE cc_7_visited_site_cocoon=2; cc_7_return_site_cocoon=2; ASPSESSIONIDQQSQRSCB=ANGMJHGBGCMJJLDNKAIBIIAI; cc_7_visited_site_cocoon=1; cc_7_return_site_cocoon=1
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_X_REWRITE_URL /code/serverVariables.asp

回复
zhangjun 2004-11-29
禁止右键
<body oncontextmenu="return false">

<s cript language="Javas cript">
<!--

if (window.Event)
document.captureEvents(Event.MOUSEUP);

function nocontextmenu()
{
event.cancelBubble = true
event.returnvalue = false;

return false;
}

function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnvalue = false;
return false;
}

}

document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</s cript>
回复
zhangjun 2004-11-29
禁止鼠标右键的动作

  <Script Language = "javascript">
  function click() { if (event.button==2||event.button==3)
  {
  alert(’禁止鼠标右键’);
  }
  document.onmousedown=click // -->
  </Script>

或:<script language="javascript">
function click() { if (event.button==2)
{alert(’*^_^*’); } } document.onmousedown=click // -->
</script>
回复
feelingbox 2004-11-29
同问~
回复
发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告