|
|
|
date: Fri, 13 Jun 2008 02:36:21 -0700 (PDT),
group: microsoft.public.inetsdk.programming.scripting.vbscript
back
Re: Using wininet over http to get a get.cgi file
On Jun 16, 11:18 pm, no...@no.void (Reventlov) wrote:
> Il giorno Fri, 13 Jun 2008 02:36:21 -0700 (PDT), Skylan ha
> scritto:
>
> >Hello, I want to access aprojectorover the network with avbscript
> >so I can read the lamp hours and status. Can someone help me with some
> >examples with wininet? I made a search (google as well as Microsoft)
> >but I can not get it in a vbscript.
>
> I use mshtml.
>
> Sub DownloadWithXMLHTTP (sSource,sDest)
> 'Download a file using activeX Object XMLHTTP
> 'and save to sDest using ADO Stream
> set oHTTP = WScript.CreateObject("Microsoft.XMLHTTP")
> oHTTP.open "GET", sSource, False
> oHTTP.send
> set oStream = createobject("adodb.stream")
> Const adTypeBinary = 1
> Const adSaveCreateNotExist = 1
> Const adSaveCreateOverWrite = 2
> oStream.type = adTypeBinary
> oStream.open
> oStream.write oHTTP.responseBody
> oStream.savetofile sDest, adSaveCreateOverWrite
> set oStream = nothing
> set oHTTP = nothing
> end sub
>
> --
> Giovanni Cenati (Bergamo, Italy)
> Write to "Reventlov" at katamail comhttp://digilander.libero.it/Cenati(Esempi e programmi in VbScript)
> --
Due to lack of knowledge I cannot get any further. I want to create an
overview of all projectors in one screen. In this overview I can see
Lamp Runtimes, Lamp Remaining, Total operation and if the projector is
ON or OFF. Via http://192.168.200.1/info.cgi I can see it with the
Internet Explorer.
Can you put me in the right direction?
date: Wed, 18 Jun 2008 06:31:00 -0700 (PDT)
author: Skylan
Re: Using wininet over http to get a get.cgi file
On Jun 18, 11:59 pm, no...@no.void (Reventlov) wrote:
> Il giorno Wed, 18 Jun 2008 06:31:00 -0700 (PDT), Skylan ha
> scritto:
>
> >Due to lack of knowledge I cannot get any further. I want to create an
> >overview of all projectors in one screen. In this overview I can see
> >Lamp Runtimes, Lamp Remaining, Total operation and if the projector is
> >ON or OFF. Viahttp://192.168.200.1/info.cgiI can see it with the
> >Internet Explorer.
>
> DownloadWithXMLHTTP ("http://192.168.200.1/info.cgi","c:\temp.txt")
>
> This creates the file c:\temp.txt containing the text returned from the cgi page. The same
> you would have in ie but without images.
> Then you have to parse the file in search of the information you need. You can parse the
> file with any program in any language you know.
> Giovanni.
>
> --
> Giovanni Cenati (Bergamo, Italy)
> Write to "Reventlov" at katamail comhttp://digilander.libero.it/Cenati(Esempi e programmi in VbScript)
> --
Thanks Giovanni, I'm back on track. ;-)
date: Thu, 19 Jun 2008 01:36:24 -0700 (PDT)
author: Skylan
Re: Using wininet over http to get a get.cgi file
"Skylan" wrote in message
news:b4a7b2e8-5878-416f-84e2-903beaab1dca@b1g2000hsg.googlegroups.com...
> On Jun 18, 11:59 pm, no...@no.void (Reventlov) wrote:
>> Il giorno Wed, 18 Jun 2008 06:31:00 -0700 (PDT), Skylan
>> ha
>> scritto:
>>
>> >Due to lack of knowledge I cannot get any further. I want to create an
>> >overview of all projectors in one screen. In this overview I can see
>> >Lamp Runtimes, Lamp Remaining, Total operation and if the projector is
>> >ON or OFF. Viahttp://192.168.200.1/info.cgiI can see it with the
>> >Internet Explorer.
>>
>> DownloadWithXMLHTTP ("http://192.168.200.1/info.cgi","c:\temp.txt")
>>
>> This creates the file c:\temp.txt containing the text returned from the
>> cgi page. The same
>> you would have in ie but without images.
>> Then you have to parse the file in search of the information you need.
>> You can parse the
>> file with any program in any language you know.
>> Giovanni.
>>
>> --
>> Giovanni Cenati (Bergamo, Italy)
>> Write to "Reventlov" at katamail
>> comhttp://digilander.libero.it/Cenati(Esempi e programmi in VbScript)
>> --
>
> Thanks Giovanni, I'm back on track. ;-)
If you want to parse the file as an html document then you create a new
"htmlfile" using:
set doc = CreateObject("htmlfile")
You can then document.write the HTML from the temp file into the doc and
parse the contents using traditional dom methods.
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
date: Fri, 20 Jun 2008 08:41:13 +0100
author: Joe Fawcett am
Re: Using wininet over http to get a get.cgi file
On Jun 20, 9:41 am, "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote:
> "Skylan" wrote in message
>
> news:b4a7b2e8-5878-416f-84e2-903beaab1dca@b1g2000hsg.googlegroups.com...
>
>
>
> > On Jun 18, 11:59 pm, no...@no.void (Reventlov) wrote:
> >> Il giorno Wed, 18 Jun 2008 06:31:00 -0700 (PDT), Skylan
> >> ha
> >> scritto:
>
> >> >Due to lack of knowledge I cannot get any further. I want to create an
> >> >overview of all projectors in one screen. In this overview I can see
> >> >Lamp Runtimes, Lamp Remaining, Total operation and if the projector is
> >> >ON or OFF. Viahttp://192.168.200.1/info.cgiIcan see it with the
> >> >Internet Explorer.
>
> >> DownloadWithXMLHTTP ("http://192.168.200.1/info.cgi","c:\temp.txt")
>
> >> This creates thefilec:\temp.txt containing the text returned from the
> >>cgipage. The same
> >> you would have in ie but without images.
> >> Then you have to parse thefilein search of the information you need.
> >> You can parse the
> >>filewith any program in any language you know.
> >> Giovanni.
>
> >> --
> >> Giovanni Cenati (Bergamo, Italy)
> >> Write to "Reventlov" at katamail
> >> comhttp://digilander.libero.it/Cenati(Esempie programmi in VbScript)
> >> --
>
> > Thanks Giovanni, I'm back on track. ;-)
>
> If you want to parse thefileas an html document then you create a new
> "htmlfile" using:
> set doc = CreateObject("htmlfile")
>
> You can then document.write the HTML from the tempfileinto the doc and
> parse the contents using traditional dom methods.
>
> --
>
> Joe Fawcett (MVP - XML)http://joe.fawcett.name- Hide quoted text -
>
> - Show quoted text -
From the info.cgi file, I only need the fields like "LAMP
RUNTIME" (value: 585 H) and "POWER" (value: ON). How can I delete all
<codes>?
Sample code:
<TD width="100%" class="monitor_table_property"><TABLE border="0"
cellSpacing="0" width="100%"><TR><TD width="330" align="left"
class="monitor_table_property"> <b>LAMP RUNTIME</b></TD><TD
align="right" width="120" class="monitor_table_property"><font
color="#00ff12"><b>585 H</b> </font></TD><TD
width="250" class="monitor_table_property"><center><TABLE border="0"
width="100%" cellSpacing="0" cellPadding="0"><TR><TD nowrap
width="19%" height="15" bgcolor="#00ff12"></TD><TD nowrap width="81height="15" bgcolor="#000000"></TD>
date: Mon, 23 Jun 2008 12:00:29 -0700 (PDT)
author: Skylan
|
|