473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Replacement for Inet Control

The following seemed so easy in VB6

Inet2.URL = HTTP://192.168.0.200/get?brightness

Dim retval As String = AxInet2.OpenURL
This would give me the string 'Brightness=34' (It's from a camera)

How do I do it with VB.Net (2005)? I've trawled through loads of code using
Webrowsers, HTTPWepresponse etc but can't get a result.

-Jerry
Jul 12 '06 #1
4 8437

Dim URI As String = "HTTP://192.168.0.200/get?brightness"

Dim wbClient As New WebClient
Dim strData As Stream = wbClient.OpenRead(URI)
Dim sr As StreamReader = New StreamReader(strData)

the return data is now in the streamreader ( use the sr `s methods to
retreive the data in the desired format )

note that you need to set up a proxy object and bind this to the webclient
if you are behind a proxy server

regards

Michel Posseth [MCP]



"Jerry Spence1" wrote:
The following seemed so easy in VB6

Inet2.URL = HTTP://192.168.0.200/get?brightness

Dim retval As String = AxInet2.OpenURL
This would give me the string 'Brightness=34' (It's from a camera)

How do I do it with VB.Net (2005)? I've trawled through loads of code using
Webrowsers, HTTPWepresponse etc but can't get a result.

-Jerry
Jul 12 '06 #2
"can't get a result". Do you mean you have an error or that you just don't
get any response ?

Seeing some code could help. System.Net.WebClient is likely the easiest path
for now. For example :
Dim w As New System.Net.WebClient
MsgBox(w.DownloadString("http://www.google.com/"))
w.Dispose()

Is the target page under your control ? For example a site could perhaps
return nothing at all if the user agant is empty...

---

Patrice
"Jerry Spence1" <je**********@somewhere.coma écrit dans le message de
news: 44***********************@ptn-nntp-reader01.plus.net...
The following seemed so easy in VB6

Inet2.URL = HTTP://192.168.0.200/get?brightness

Dim retval As String = AxInet2.OpenURL
This would give me the string 'Brightness=34' (It's from a camera)

How do I do it with VB.Net (2005)? I've trawled through loads of code
using Webrowsers, HTTPWepresponse etc but can't get a result.

-Jerry


Jul 12 '06 #3
"Jerry Spence1" <je**********@somewhere.comschrieb:
Inet2.URL = HTTP://192.168.0.200/get?brightness

Dim retval As String = AxInet2.OpenURL
This would give me the string 'Brightness=34' (It's from a camera)

How do I do it with VB.Net (2005)? I've trawled through loads of code
using Webrowsers, HTTPWepresponse etc but can't get a result.
<URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jul 12 '06 #4
Ah - that's perfect. Thank you very much

-Jerry

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:ez**************@TK2MSFTNGP04.phx.gbl...
"Jerry Spence1" <je**********@somewhere.comschrieb:
>Inet2.URL = HTTP://192.168.0.200/get?brightness

Dim retval As String = AxInet2.OpenURL
This would give me the string 'Brightness=34' (It's from a camera)

How do I do it with VB.Net (2005)? I've trawled through loads of code
using Webrowsers, HTTPWepresponse etc but can't get a result.

<URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jul 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Laphan | last post by:
Hi All Just wanted to know if anybody knows the answer to the following quick queries: 1) The reason I'm using VB's INET control is to download copies of Ms Access DBs on a range of web sites...
0
by: AstrA | last post by:
Hi All Using the INET control to extract data from web sites and was told that the user agent should really be spoofed to make it look like a browser, as search engines sometimes black list...
4
by: Steen Gellett | last post by:
Hallo.....I have programmed with winsock for a while, but now I have set my eyes on Inet, but I'm totally blank........a few questions ?? Inet1.Protocol = icFTP......................I can see...
0
by: jtmerch | last post by:
what's the best option for using the Inet control in VB.net? Is there a control that's built for the .net framework that's similar to or better than the old Inet control? I'm opening a URL and...
0
by: Rick | last post by:
Hi, I haven't been able to find a solution anywhere yet. I have a Vb6 application that has to be rewritten as a vb.net app and in the old application the inet control was set as: ...
3
by: Rick | last post by:
Hi, I haven't been able to find a solution anywhere yet. I have a Vb6 application that has to be rewritten as a vb.net app and in the old application the inet control was set as: ...
0
by: QT | last post by:
Dear sirs, I am using inet control to vrowse web in my program. My line is very slow. I want to make my inet control to wait more than Internet Explorer defaul time. Error page is coming very...
2
by: Rob | last post by:
Hi, My name is Rob I have been trying to use the System.Net.Webclient function without success. In VB6 to get the latest version I simple did this: if...
7
by: Lou | last post by:
What is the .NET equivelent of the iNet control I tried FtpWebRequest but that doesn't do it. All I want to do is give an ipaddress, user name and password, send a CD command and a DIR command to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.