kimrune Posted June 24, 2003 Posted June 24, 2003 Hey.. I would like to use the internet transfer control, but when adding this code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Inet1.Protocol = icHTTP Inet1.URL = Text1.Text Inet1.Execute(, "GET") End Sub I get build errors saying that Inet1 is not declared... I probably need to add some controls, but the problem is, I don't know from where? I can't find any control in the tool box or wherever that has anything to do with the internet transfer control? Would appreciate some help here :) Quote
*Experts* mutant Posted June 24, 2003 *Experts* Posted June 24, 2003 INet doesnt ship with Vs.NET so you need to have VS6 installed or get it from somewhere else to use it anywhere. And INet is not recommended for .NET. Look into those namespaces: System.Net System.Net.Sockets They provide functionality you need. Quote
kimrune Posted June 24, 2003 Author Posted June 24, 2003 Thanx :) I'm not too familiar with System.Net so if you know of any tutorials or if you have any hints on how to get me started in the right direction I would be very happy.. Thanx for the reply.. Quote
kimrune Posted June 24, 2003 Author Posted June 24, 2003 I need to put the result from an URL into a string.. Quote
Administrators PlausiblyDamp Posted June 24, 2003 Administrators Posted June 24, 2003 At the top of the form module put Imports System.Net Imports System.Text and in the button click paste the following Dim wc As New WebClient Dim s As String Dim b() As Byte b = wc.DownloadData(TextBox1.Text) s = Encoding.ASCII.GetString(b) s should now be the raw text of whatever the url in textbox1 was. ps you need to enter the protocol as part of the url i.e. http://www.b3ta.com will fail http://www.b3ta.com should work Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
kimrune Posted June 24, 2003 Author Posted June 24, 2003 Thank you.. You helped me out a lot :) 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.