page511.vbs

来自「Apress - Managing Enterprise Systems Wit」· VBS 代码 · 共 18 行

VBS
18
字号
Const adReadLine = -2
Const adTypeText = 2
'read the contents of a Web file
Set objStream = CreateObject("ADODB.Stream")
'open to log.txt file on www.acme.com site
objStream.Open "URL=http://www.acme.com/log.txt" 
'set type to text and character set to Ascii
objStream.Type = adTypeText
objStream.charset = "ascii"

'read contents of file and output 
Do While Not objStream.EOS
 'read the next line of text
  strLine = objStream.ReadText(adReadLine)
  Wscript.Echo strLine
Loop
objStream.Close

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?