윈도우에서 태스크 스케쥴러를 이용해 매일 한번 스크립트를 실행하고 그 결과물을 첨부해서 특정이메일로 보내면, SharePoint서버가 자동으로 그 문서를 업로드하는 것이 요구사항이다.
### vb
Dim FSO, dFile, sHTML
sHTML = Get_HTML ("http://url-to-send")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set dFile = FSO.CreateTextFile("filename.csv", True)
dFile.Write UniToAsc(sHTML)
dFile.Close
Set dFile = Nothing
Set FSO = Nothing
Private Function Get_HTML (up_http)
Dim xmlhttp
Set xmlhttp = createobject("msxml2.xmlhttp.6.0")
xmlhttp.open "get", up_http, False
xmlhttp.send
Get_HTML = xmlhttp.responsetext
set xmlhttp = Nothing
End Function
Private Function UniToAsc(sString)
Dim nLen, nPTR, sAsc
nLen = Len(sString)
For nPTR = 1 To nLen
sAsc = sAsc & Chr(Asc(Mid(sString, nPTR, 1)))
Next
UniToAsc = sAsc
End Function
'IT > etc' 카테고리의 다른 글
vi 에디터에서 특정 캐릭터를 가지고 개행을 할 경우 (0) | 2011.11.23 |
---|---|
티스토리에서 syntax hightlight하기 (0) | 2011.11.23 |
how to avoid autorun.inf file getting generated in a folder (0) | 2011.11.23 |
Apache(아파치)에서 크로스 사이트 스크립팅(cross site scripting: xss) 허용하기 (0) | 2011.11.23 |
HTML 태그를 없애버리는 템플릿 (0) | 2011.11.23 |