举个栗子:- 1>1/* :
- @echo off
- for /f "delims=" %%a in ('cscript -nologo -e:jscript "%~0"') do set "response=%%a"
- set response
- pause&exit /b
- */
-
- with(new ActiveXObject('Msxml2.XMLHTTP')){
- Open('GET','http://bbs.bathome.net/thread-33139-1-1.html',0)
- setRequestHeader('CONTENT-TYPE','text/xml;charset=gb2312;')
- Send()
- WScript.Echo(readBy(responseBody,'gb2312'))
- }
-
- function readBy(bin,charset){
- var steam = new ActiveXObject("ADODB.Stream")
- steam.Type = 1
- steam.Mode = 3
- steam.Open()
- steam.Write(bin)
- steam.Position = 0
- steam.Type = 2
- steam.Charset = charset
- return steam.ReadText
- }
复制代码
|