Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News System (Pulled from URL)
#1
Okay, this is a simple tut. Very simple actually. First off..

Open up your client source. Add the component..

Code:
Microsoft Internet Transfer Control 6.0

Now, place that component (INet) on frmMainMenu..

Name it..

Code:
InetNews

Now, if you wish to use colors, images, and such in your news box, add a rich text box (I won't go into explanation for adding images/color), otherwise, add a normal text box.

Name it..

Code:
txtNews

Add this sub, if you don't already have it, if you do, just add the code inside this sub..

Code:
Private Sub Form_Load()
Dim TmpStr As String

    TmpStr = InetNews.OpenURL("http://tpo.phpnet.us/News.txt")

    txtNews.Text = TmpStr
End Sub

I left my test url in there, just replace it with the url you will use.

And that's it. It will now pull the text from the text file in the url.

Enjoy!

Later, I will write one to pull the news from the game's server, which also, isn't hard.

Hope this helps someone.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)