[Tutorial]External Notice

Posts 1–11 of 11 · Page 1 of 1
[Tutorial]External Notice
So, I'll teach you how to make a notice, which you can update anytime, without updating your program.


Above public class you'll need to write the following:

Code:
Imports System.net
Under public class where you usually declare stuff:

Code:
#Region "Settings"
    Const strNotice As String = "http://link-to-your/notice.txt"

#End Region

Using a richtextbox:

Code:
Sub LoadNotice()
        Try
            Dim request As HttpWebRequest = WebRequest.Create(strNotice)
            Dim response As HttpWebResponse = request.GetResponse()
            Dim reader As StreamReader = New StreamReader(response.GetResponseStream())
            Richtextbox1.Text = reader.ReadToEnd()
            response.Close()
            reader.Close()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
You might put this into form_load or on any button:

Code:
 LoadNotice()
Just upload the .txt to your root/ftp w/e.

Try it out

Thank me if I helped you

Good job.

Really n00by tutorial though.
Quote Originally Posted by Lolland View Post
Good job.

Really n00by tutorial though.
lol you say that to every tutorial.
Quote Originally Posted by XGelite View Post
lol you say that to every tutorial.
Not to Nextgen's
Information may come in handy, Tutorial lacks a little, But not bad.
Good Job tutorial could use a few pics but overall good
Not bad. Will try later
All I did for mine was
Dim client As New System.Net.WebClient()
RichTextBox1.Text = client.DownloadString("www."".txt")
i have an error. it says streamreader is not defined.
Code:
Imports System.IO
Put that at at the top.

And please refrain from bumping old threads.
Imports System.net
Imports System.IO

let me know if that helps
Posts 1–11 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us