最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 复制文件与保存远程服务器文件
时间:2022-06-30 11:41:53 编辑:袖梨 来源:一聚教程网
'==============================
'函 数 名: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