最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 复制文件与保存远程服务器文件
时间:2009-07-11 编辑:简简单单 来源:一聚教程网
'==============================
'函 数 名:CopyFiles
'作 用:复制文件
'参 数:文件来源地址SourcePath,文件复制到地址CopyToPath
'==============================
Function CopyFiles(SourcePath,CopyToPath)
Set Fso=Server.CreateObject("Scri"&"pting.File"&"Sys"&"temObject")
Fso.CopyFile Server.MapPath(SourcePath),Server.MapPath(CopyToPath)
Set Fso=nothing
End Function
'==============================
'函 数 名:SaveRemoteFile
'作 用:保存远程图片
'参 数:图片来源网址SourceUrl,图片保存地址SavePath
'==============================
Sub SaveRemoteFile(SourceUrl,SavePath)
On Error Resume Next
Set Temp = Server.CreateObject("Mic"&"roso"&"ft.XML"&"HT"&"TP")
With Temp
.Open "Get", SourceUrl, False, "", ""
.Send
If Err.number<>0 Then
Exit Sub
End If
F = .ResponseBody
End With
Set Temp = Nothing
Set objAdoStream = Server.CreateObject("A"&"dod"&"b.St"&"r"&"eam")
With objAdoStream
.Type = 1
.Open
.Write F
.SaveToFile Server.MapPath(SavePath), 2
.Cancel()
.Close()
End With
Set objAdoStream=nothing
End Sub
End Class
相关文章
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16
- asp中获取日期为星期几的技巧 09-14