dNagel
Fri Nov 10 14:29:35 CST 2006
darnit... I do to much js lately...
function oSck_DataArrival(totalbytes)
Dim data
oSck.GetData data, vbString
MsgBox data
end function
dNagel wrote:
> try it this way... instead of
>
> oSck.getData InData, VBString
> WriteData InData
>
> try this :
>
> function oSck_DataArrival(totalbytes) {
> Dim data
> socket.GetData data, vbString
> MsgBox data
> }
>
> D.
>
> yawnmoth wrote:
>> OfficeGuyGoesWild wrote:
>>
>>> I can't create this object on my pc so I can't test for you, but I have
>>> found a similar problem which may be of some use:
>>>
>>>
http://www.dbforums.com/t885523.html
>>>
>> I had to install Visual Studio 6 to get it working, myself.
>>
>> Anyway, the link helped! I'm now able to send http requests (as
>> revealed by the network analyzer WireShark). Unfortunately, I'm not
>> sure how to actually display the contents? Here's the code that I
>> have, thus far:
>>
>> Set oSck = WScript.CreateObject("MSWinsock.Winsock")
>> MsgBox(oSck.localIP)
>>
>> oSck.RemoteHost = "64.233.167.99"
>> oSck.RemotePort = 80
>> oSck.connect
>>
>> seconds = 0
>> Do While oSck.state <> 7 and seconds <> 25
>> WScript.Sleep 1000
>> seconds = seconds + 1
>> Loop
>>
>> If seconds = 25 Then Wscript.Quit
>>
>> oSck.sendData "GET / HTTP/1.0" & vbCrlf
>> oSck.sendData "Host: www.google.com" & vbCrlf & vbCrlf
>>
>> oSck.getData InData, VBString
>> WriteData InData
>>
>> MsgBox(InData)
>>
>> As written, I get this error:
>>
>> Windows Script Host
>>
>> Script: C:\dirname\test.vbs
>> Line: 20
>> Char: 1
>> Error: Type mismatch: 'WriteData'
>> Code: 800A000D
>> Source: Microsoft VBScript runtime error
>>
>> If I comment out the WriteData line, I get an empty alert box (when I
>> should, in fact, be getting an alert box with a lot of unparsed html).
>>
>> Any ideas?
>>
>>