Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all,

 

Does VB.NET has a similar control to the VB6 "inet"

for easy internet access?

I looked in the toolbox and the components list but

could'nt find anything.

If VB.Net does not have such a control, what did

microsoft offer in it's place ?

 

Thanks to anyone who can help,

Logicworks

  • 1 year later...
  • Leaders
Posted

They are not controls, they are components, but they are not found in the ToolBox by default. You can instantiate them in code.

[Vb]

Dim X As New System.Net.WebClient

Dim Y As System.Net.WebRequest = System.Net.WebRequest.Create(MyUri)

[/code]

[sIGPIC]e[/sIGPIC]
Posted
They are not controls, they are components, but they are not found in the ToolBox by default. You can instantiate them in code.

[Vb]

Dim X As New System.Net.WebClient

Dim Y As System.Net.WebRequest = System.Net.WebRequest.Create(MyUri)

[/code]

 

Wow, VB.Net is difficult. MY URI is not declared o.0

  • Leaders
Posted

you need to declare myUri as a new URI ( you can also specify a url as a string )

 

eg:

[font=Courier New][size=2][color=#008000]'/// declare myUri ( note : you can also use a string as the uri in your request , eg: HttpWebRequest.Create("http://msn.co.uk/") )[/color][/size][/font]

[font=Courier New][size=2][color=#0000ff]Dim[/color][/size][size=2] myUri [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]New[/color][/size][size=2] Uri([url="http://msn.co.uk/"]http://msn.co.uk/[/url])[/size][/font]
[font=Courier New][size=2][color=#008000]'/// make a request to the URI ...[/color][/size][/font]

[font=Courier New][size=2][color=#0000ff]Dim[/color][/size][size=2] request [/size][size=2][color=#0000ff]As[/color][/size][size=2] WebRequest = [/size][size=2][color=#0000ff]DirectCast[/color][/size][size=2](WebRequest.Create(myUri), WebRequest)[/size][/font]
[font=Courier New][size=2][color=#0000ff]Dim[/color][/size][size=2] response [/size][size=2][color=#0000ff]As[/color][/size][size=2] WebResponse = request.GetResponse[/size][/font]
[font=Courier New][size=2]MessageBox.Show(response.Headers.ToString)

[/size][/font]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...