无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
<%
On Error Resume Next
Const uploadPath = "/uploads/" '文件存放路径
Const allowFileExt = "jpg,wma,swf,gif" '允许被采集的文件类型
'Const allowFileSize = "200"
Function getFile(url)
If url = "" Then
Exit Function
Else
url = Trim(url)
End If
'获取文件
fileExt = Lcase(Mid(url,Instrrev(url, ".")+1)) '文件类型
fileName = Lcase(Mid(url,Instrrev(url, "/")+1,Instrrev(url, ".")-Instrrev(url, "/")-1)) '无文件类型的文件名
newFilePath = getNow("Date") & "_" & Replace(FormatDateTime(Now(),3),":","") & "_" & cleanFileName(fileName) & "." & fileExt
if Instr(","&Lcase(allowFileExt)&",",","&fileExt&",") = 0 Then
getFile = "文件类型不允许"
Exit Function
End If
Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "get",url,false
xmlhttp.send
'While xmlhttp.readyState <> 4
' xmlhttp.waitForResponse 1000
'Wend
If xmlhttp.status <> 200 Then
getFile="获取文件出错"
Exit Function
Else
Set folder=Server.CreateObject("Scripting.FileSystemObject")
Dim folderName
folderName = getNow("Year")&getNow("Month") '文件夹
If folder.FolderExists(Server.MapPath(uploadPath))=False Then
folder.CreateFolder Server.MapPath(uploadPath)
End If
If folder.FolderExists(Server.MapPath(uploadPath & folderName))=False Then
folder.CreateFolder Server.MapPath(uploadPath & folderName)
End If
Set folder=Nothing
file=xmlhttp.ResponseBody
If lenb(file) > allowFileSize Then
getFile = "文件太大,不能保存!"
Exit Function
Else
Set objAdostream=Server.Createobject("ADODB.Str"&"eam")
objAdostream.Open()
objAdostream.Type=1
objAdostream.Write(file)
objAdostream.SaveToFile(Server.Mappath(uploadPath & folderName &"/" & newFilePath))
objAdostream.SetEOS
Set objAdostream=Nothing
getFile= "<a href="""&uploadPath & folderName &"/" & newFilePath&""" target=""_balnk"">采集成功</a>"
End If
End If
Set xmlhttp=Nothing
End Function
%>
<script runat="server" language="jscript">
function cleanFileName(str){
str = str.replace(/[^_\.a-zA-Z\d]/ig,"");
str = str.replace(/^[\/\.]+/,"");
return str;
}
function getNow(n)
{
d = new Date();
switch (n)
{
case "Year":
return d.getYear();
case "Month":
return (d.getMonth() + 1);
case "Date":
return d.getDate();
}
}
</script>
<%if request("do")="getfile" and request("file") <> "" then
response.write(getFile(request("file")))
else%>
<form id="gform" method="post" action="?do=getfile" style="display: inline">
<input name="file" type="input" style="font-size:12px;" size="40" value="http://blog.xiaobin.net/uploads/200512/08_093616_01.gif">
<input type="Submit" name="Submit" value="采集 " class="button">
</form>
<%end if%>
<%
On Error Resume Next
Const uploadPath = "/uploads/" '文件存放路径
Const allowFileExt = "jpg,wma,swf,gif" '允许被采集的文件类型
'Const allowFileSize = "200"
Function getFile(url)
If url = "" Then
Exit Function
Else
url = Trim(url)
End If
'获取文件
fileExt = Lcase(Mid(url,Instrrev(url, ".")+1)) '文件类型
fileName = Lcase(Mid(url,Instrrev(url, "/")+1,Instrrev(url, ".")-Instrrev(url, "/")-1)) '无文件类型的文件名
newFilePath = getNow("Date") & "_" & Replace(FormatDateTime(Now(),3),":","") & "_" & cleanFileName(fileName) & "." & fileExt
if Instr(","&Lcase(allowFileExt)&",",","&fileExt&",") = 0 Then
getFile = "文件类型不允许"
Exit Function
End If
Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "get",url,false
xmlhttp.send
'While xmlhttp.readyState <> 4
' xmlhttp.waitForResponse 1000
'Wend
If xmlhttp.status <> 200 Then
getFile="获取文件出错"
Exit Function
Else
Set folder=Server.CreateObject("Scripting.FileSystemObject")
Dim folderName
folderName = getNow("Year")&getNow("Month") '文件夹
If folder.FolderExists(Server.MapPath(uploadPath))=False Then
folder.CreateFolder Server.MapPath(uploadPath)
End If
If folder.FolderExists(Server.MapPath(uploadPath & folderName))=False Then
folder.CreateFolder Server.MapPath(uploadPath & folderName)
End If
Set folder=Nothing
file=xmlhttp.ResponseBody
If lenb(file) > allowFileSize Then
getFile = "文件太大,不能保存!"
Exit Function
Else
Set objAdostream=Server.Createobject("ADODB.Str"&"eam")
objAdostream.Open()
objAdostream.Type=1
objAdostream.Write(file)
objAdostream.SaveToFile(Server.Mappath(uploadPath & folderName &"/" & newFilePath))
objAdostream.SetEOS
Set objAdostream=Nothing
getFile= "<a href="""&uploadPath & folderName &"/" & newFilePath&""" target=""_balnk"">采集成功</a>"
End If
End If
Set xmlhttp=Nothing
End Function
%>
<script runat="server" language="jscript">
function cleanFileName(str){
str = str.replace(/[^_\.a-zA-Z\d]/ig,"");
str = str.replace(/^[\/\.]+/,"");
return str;
}
function getNow(n)
{
d = new Date();
switch (n)
{
case "Year":
return d.getYear();
case "Month":
return (d.getMonth() + 1);
case "Date":
return d.getDate();
}
}
</script>
<%if request("do")="getfile" and request("file") <> "" then
response.write(getFile(request("file")))
else%>
<form id="gform" method="post" action="?do=getfile" style="display: inline">
<input name="file" type="input" style="font-size:12px;" size="40" value="http://blog.xiaobin.net/uploads/200512/08_093616_01.gif">
<input type="Submit" name="Submit" value="采集 " class="button">
</form>
<%end if%>
标签:
自动采集程序
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年11月16日
2024年11月16日
- 模拟之声慢刻CD《柏林之声4》[正版CD低速原抓WAV+CUE]
- 李宗盛 《李宗盛经典金曲》[WAV+CUE][1G]
- 周华健《粤语精选》[WAV+CUE][1G]
- 蔡婧2024《天空》HQCDII头版限量编号[WAV+CUE][1G]
- 陈奂仁.2011-谁是陈奂仁【BBS】【FLAC分轨】
- 群星.2024-幻乐森林影视原声带【韶愔音乐】【FLAC分轨】
- 黎明.1999-向往金色的黎明新歌+精选2CD【环球】【WAV+CUE】
- 发烧女声Méav《美芙的祈祷》发烧女声 [WAV+CUE][820M]
- 雷婷 《我的爱回不来》紫银合金AQCD [WAV+CUE][1G]
- 群星 DTS《天籁之音·唱醉了草原》2CD[WAV分轨][1.6G]
- 魔兽世界wlk毁灭术一键输出宏是什么 wlk毁灭术一键输出宏介绍
- 三国志8重制版无法与武将交流怎么办 无法与武将交流解决方法一览
- 三国志8重制版恶名怎么消除 恶名影响与消除方法介绍
- 模拟之声慢刻CD《柏林之声5》2019[原抓WAV+CUE]
- AlexandraSoumm-Parisestunefte(2024)[24Bit-96kHz]FLAC