Logicworks Posted August 11, 2003 Posted August 11, 2003 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 Quote
Moderators Robby Posted August 11, 2003 Moderators Posted August 11, 2003 you can use the Net.WebClient. Quote Visit...Bassic Software
BrianHansen Posted August 12, 2003 Posted August 12, 2003 Or use the Net.WebRequest (more powerful in my opinion) Quote
xcannon Posted June 25, 2005 Posted June 25, 2005 I just gotr VB.Net today, and I want to use something similar to inet, where do I add thos controls? I cannot find them Quote
Leaders snarfblam Posted June 25, 2005 Leaders Posted June 25, 2005 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] Quote [sIGPIC]e[/sIGPIC]
xcannon Posted June 26, 2005 Posted June 26, 2005 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 Quote
Leaders dynamic_sysop Posted June 27, 2005 Leaders Posted June 27, 2005 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] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.