QuestionRecieve data

Posts 1–10 of 10 · Page 1 of 1
Recieve data
Okay i have seen some pretty similar things to this but not quite this......i was wondering if anyone know a code that makes it so a TextBox1.text equals online data like say for instance:
I have a text file on the internet that says "HELLO" (yes i have a text file in my website, so it is accessible)
and
I want the "HELLO" to appear inside of the textbox on my application

Anyone know at all?
Try this:

Apply a webbrowser to your application (preferably hidden), set it to navigate to your web page.
Code:
Webbrowser1.navigate="Your website URL"
Then:
Code:
TextBox1.Text = WebBrowser1.DocumentText
ahh nice and smart thank you

bad thing is , it wont work lol
Quote Originally Posted by guza44_44 View Post
ahh nice and smart thank you

bad thing is , it wont work lol
Why won't it work?
Quote Originally Posted by -XpliCitt- View Post
Why won't it work?
Yes -Xplicitts- code is right...it should work
it says this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY><PRE>1</PRE></BODY></HTML>
all i want it to show the number "1" but it wants to show all the php and html code and idk why
Quote Originally Posted by guza44_44 View Post
it says this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY><PRE>1</PRE></BODY></HTML>
all i want it to show the number "1" but it wants to show all the php and html code and idk why
You can also just put the 1 in the header and use this:
Code:
WebBrowser1.DocumentTitle.ToString
Code:
Dim WebFile As String
        WebFile= "URLTOTEXTFILE"
        Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(WebFile)
        Dim response As System.Net.HttpWebResponse = request.GetResponse()
        Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252"))
        Textbox1.Text = sr.ReadToEnd()
Edit in Pure HTML and delete all that header shit and just type in what you want it to read instead.
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us