|
$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
While 1
$filename="d:\增量统计\"&@MON&"-"&@MDAY&".xml"
If FileExists($filename) Then
Sleep(3600000)
Else
$oHTTP.Open("GET","http://***",false)
;$oHTTP.setRequestHeader("Cache-Control", "no-cache")
$oHTTP.setRequestHeader("Accept-Language", "zh-cn")
$oHTTP.setRequestHeader("Connection", "Keep-Alive" )
$oHTTP.setRequestHeader("Referer","http://***")
$oHTTP.Send()
;MsgBox(0,"",$oHTTP.responseText)
$text=$oHTTP.responseText
$file = FileOpen($filename, 258)
FileWrite($file, $text)
FileClose($file)
EndIf
WEnd
2003下生成的文件中文是乱码,要对获取的数据进行编码? |
|