게시판 본문 ASP, ASP.NET, IIS & Script - Read Only
| re: 전통적인 ASP 환경에서 작업하는 경우 |
|---|
|
작성자: 송원석
작성일시: 2005-09-28 21:49,
조회수: 7,647
|
|
이 경우에는 다음의 함수를 사용하시면 됩니다. 제가 직접 작성한 함수는 아니고 예전에 구글에서 발견해서 정리해 놓았던 코드입니다. 원본의 출처는 기억이 잘 나지 않는군요. 참고하시기 바랍니다.
Public Function SaveWebBinary(strUrl, strFile)
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
Const ForWriting = 2
Dim web, varByteArray, strData, strBuffer, lngCounter, ado
On Error Resume Next
Err.Clear
Set web = Nothing
Set web = CreateObject("WinHttp.WinHttpRequest.5.1")
If web Is Nothing Then Set web = CreateObject("WinHttp.WinHttpRequest")
If web Is Nothing Then Set web = CreateObject("MSXML2.ServerXMLHTTP")
If web Is Nothing Then Set web = CreateObject("Microsoft.XMLHTTP")
web.Open "GET", strURL, False
web.Send
If Err.Number <> 0 Then
SaveWebBinary = False
Set web = Nothing
Exit Function
End If
If web.Status <> "200" Then
SaveWebBinary = False
Set web = Nothing
Exit Function
End If
varByteArray = web.ResponseBody
Set web = Nothing
Set ado = Nothing
Set ado = CreateObject("ADODB.Stream")
If ado Is Nothing Then
Set fs = CreateObject("Scripting.FileSystemObject")
Set ts = fs.OpenTextFile(strFile, ForWriting, True)
strData = ""
strBuffer = ""
For lngCounter = 0 to UBound(varByteArray)
ts.Write Chr(255 And Ascb(Midb(varByteArray, lngCounter + 1, 1)))
Next
ts.Close
Else
ado.Type = adTypeBinary
ado.Open
ado.Write varByteArray
ado.SaveToFile strFile, adSaveCreateOverWrite
ado.Close
End If
SaveWebBinary = True
End Function
코드가 무척 흥미롭다는 것을 알 수 있으실 것입니다. ^_^감사합니다. |
|
IP 주소: 211.226.151.37
|
전체 2 건의 댓글이 존재합니다.
|
송원석 |
다음의 사이트가 원본 코드의 출처입니다. 겨우 찾았네요. 또 다른 흥미로운 코드들을 많이 발견하실 수 있으실 것입니다.
|
2005-09-28 21:58 |
|
송원석 |
2005-09-28 21:59 |
전체 2,095 건의 게시물,
84 페이지로 구성된
ASP, ASP.NET, IIS & Script 게시판의
1 페이지입니다.
|
게시물 | |||
|---|---|---|---|---|
| 2,208 | 2011-05-25 | 17,653 | ||
| 2,207 | 2011-05-27 | 7,931 | ||
| 2,206 |
이석환 |
2011-05-20 | 124 | |
| 2,205 | 2011-05-23 | 7,673 | ||
| 2,204 |
이석환 |
2011-05-17 | 130 | |
| 2,203 | 2011-05-17 | 7,435 | ||
| 2,202 |
동영상 탑재 사이트 구축 [1] |
2011-05-12 | 7,371 | |
| 2,201 | 2011-05-12 | 7,452 | ||
| 2,200 | 2011-04-24 | 7,580 | ||
| 2,199 | 2011-04-25 | 18,063 | ||
| 2,197 |
김종식 |
2011-03-30 | 228 | |
| 2,196 | 2011-03-31 | 7,275 | ||
| 2,195 |
gosuzzang |
2011-03-23 | 290 | |
| 2,194 | 2011-03-24 | 7,692 | ||
| 2,193 |
이석환 |
2011-03-23 | 253 | |
| 2,192 | 2011-03-24 | 7,717 | ||
| 2,191 |
이석환 |
2011-03-18 | 345 | |
| 2,190 | 2011-03-19 | 7,974 | ||
| 2,189 | 2011-03-21 | 7,346 | ||
| 2,188 |
이석환 |
2011-03-21 | 258 | |
| 2,187 | 2011-03-21 | 7,808 | ||
| 2,186 |
질문 |
2011-03-18 | 311 | |
| 2,185 | 2011-03-18 | 9,883 | ||
| 2,184 |
이석환 |
2011-03-11 | 345 | |
| 2,183 | 2011-03-14 | 11,203 |

sign in
join
re: win2008 iis에 관한 문의가 좀 있습니다.