200分求ASP+XML的应用小例子,受到后,即可发令100分贴

PrimerCC 2003-11-22 01:16:47
EMAIL:supeiwang@163.net
...全文
52 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
heroqxn 2003-11-22
  • 打赏
  • 举报
回复
晕,贴错了
heroqxn 2003-11-22
  • 打赏
  • 举报
回复
index.htm
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<html>
<head>
<title>::::DownLoad::::</title>
<SCRIPT LANGUAGE=javascript>
<!--
var where = ""; // Mouse position

function checkwhere(e) {
if (document.layers){
xCoord = e.x;
yCoord = e.y;
}
else if (document.all){
xCoord = event.clientX;
yCoord = event.clientY;
}
else if (document.getElementById){
xCoord = e.clientX;
yCoord = e.clientY;
}
self.status = "X座标值= "+ xCoord + " Y座标值= " + yCoord + " ---欢迎你的光临";
document.all.cc.style.top=yCoord+document.body.scrollTop+20;
document.all.cc.style.left=xCoord+20;
}

document.onmousemove = checkwhere;
if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}

function affirm(targ){
var name=window.prompt("Hello","Please input your name");
filename=targ.id;
//alert(filename);
if (name==null){
return false;
}
if (name=='' || name=="Please input your name"){
alert("?? 还是填个名字吧......\b\b\b\b\b\b\b\n\n\b\b\b不然没法下载哦");
return false;
}
name=name + "(<%=Request.ServerVariables ("remote_addr")%>)";
sendmail(filename);
return true;
}

//-->
</SCRIPT>
<SCRIPT LANGUAGE=vbscript>
Sub sendmail(filename)
Dim xmlhttp1
set xmlhttp1=createobject("Msxml2.xmlhttp")
xmlhttp1.open "post","server.asp?filename="&filename,False
xmlhttp1.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp1.send
sendmail=xmlhttp1.responseText
set xmlhttp1=nothing
end sub
Dim xmlHttp
Function GetFile(path, suffix)

Set xmlHttp = CreateObject("Msxml2.XMLHTTP")

xmlHttp.OnReadyStateChange = GetRef("GetStatus")
xmlHttp.Open "POST", "server.asp?path=" & path & "&suffix=" & suffix, true
xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlHttp.Send

'GetFile = xmlHttp.responseText
'
End Function
Set xmlHttp = nothing
Sub GetStatus()
if xmlHttp.readyState=1 or xmlHttp.readyState=2 or xmlHttp.readyState=3 then
document.all.filelist.innerhtml="<font color=red>Load...</font>"
'msgbox "1.2"
elseif xmlHttp.readyState=4 then
document.all.filelist.innerHTML=xmlHttp.responseText
'msgbox "3.4"
end if
End Sub

sub showfile()
dim path,suffix
'document.all.filelist.innerhtml="<font color=red>Load...</font>"
path=document.all.fpath.value
if right(path,1)<>"/" then
path=path&"/"
end if
suffix=document.all.fsuffix.value
call GetFile(path,suffix)
end sub

</SCRIPT>
<style>
<!--
body { font-family: 宋体; font-size: 9pt}
A { COLOR: #000000; FONT-FAMILY: 宋体; TEXT-DECORATION: none}
A:hover { COLOR: green; FONT-FAMILY: 宋体; TEXT-DECORATION: underline}
input { font-size: 9pt; color: #736659; border-color: #CCCCCC #333333 #333333 #CCCCCC; background-color: #f0f0f0; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
-->
</style>
</head>
<body onload="showfile()" oncontextmenu="window.status='^_^......';return false;" background="../image/bg.gif" leftmargin="20" topmargin="10">
<div id="cc" style="position:absolute;left:0px;top:100px;width:100%;height:20px;background:#f0f0f0;display:;filter: Alpha(opacity=50);z-index:0;" align="right">
<marquee direction=left width=200px height=18px scrollamount="1" scrolldelay="60">如果你有什么好东西的话,一定要共享哦...</marquee>
</div>
<input type=hidden size=15 id="fpath" value="<%=qs%>"> <input type=hidden size=15 id="fsuffix">
<table width="680" cellspacing="0" cellpadding="2" bordercolor="#009900" border="1">
<tr>
<td bordercolor="#FFFFFF">    
<input type=button onclick="showfile()" id=button1 name=button1 value=" 刷 新 ">    <input type=button value=" 返回首页 " onclick="window.location='../';">
</td>
</tr>
</table>
<br>
<div id="filelist"><font color=red>Load...</font></div>
<br>
</body>
</html>
heroqxn 2003-11-22
  • 打赏
  • 举报
回复
server.asp
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%@ Language=VBScript %>
<%Response.ContentType = "text/xml; charset=gb2312"
f_path=request("path")
f_suffix=request("suffix")
if f_path<>"" then
Dim fso, f, fc, fi,f_path,f_suffix,fd,fdc,fdcf

Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(Server.MapPath(f_path))) Then
Set f = fso.GetFolder(Server.MapPath(f_path))
set fd= f.SubFolders
Response.Write "<br><font color=green><b><u>"&server.MapPath (f_path)&"</u></b></font><br><br>"
for each fdc in fd
Response.Write "<img src=f.gif border=0 alt=文件夹> <a target='_blank' href=default.asp?"&server.URLEncode(f_path)&server.URLEncode(fdc.name)&"><font color=green><b id="&fdc.name&">"&fdc.name&"</b></font></a><br>"
next
Set fc = f.Files

for each fi in fc
response.write "  <img src=ff.gif alt=文件><a onclick='return affirm(this);' href="&server.htmlEncode(f_path)&server.htmlEncode(fi.name)& " id="&fi.name&">" &fi.name&"</a> size:"&fi.size&"<br>"
next
Set fc = Nothing
Set f = Nothing
Else
Response.Write "<br><font color=red>Error: No such virtual path - " & f_path &"</font>"
End If
Set fso = Nothing

end if

%>
xzq686 2003-11-22
  • 打赏
  • 举报
回复
网上的实例多的是呀!兄弟何不上网上找呢!
xzq686 2003-11-22
  • 打赏
  • 举报
回复
兄台:下面的网址上有!
http://www.yesky.com/20030310/1656014.shtml

28,407

社区成员

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

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