|
-
Jun 21st, 2007, 07:50 AM
#1
Thread Starter
New Member
.OCX Challenge
Hi there,
I have a BIG question to you guys.
I want to make a programma that will show in a label information that has been get from the internet.
------------------------------------------------------
The thing is called METAR (thats just the name) and it provides a weather info from airports to a pilot.
I searched the net and i found that I need the msinet.ocx file with the relating code :
Let MyMETAR = Inet1.OpenURL("http://weather.noaa.gov/pub/data/observations/metar/stations/" & UCase(station) & ".TXT")
Let lblMETAR.Caption = MyMETAR
This is where the info shall be get from :
http://weather.noaa.gov/pub/data/obs...tions/XXXX.TXT
the XXXX at the end is the option that should be select in a combobox
ex.
Case is EBBR
then
http://weather.noaa.gov/pub/data/obs...tions/EBBR.TXT
where 'station' is the airport code (selected in a combobox ) and Inet1 is the name of the inet object of the form...
------------------------------------------------------
Now I have an experience with OOP but not that much and i'm using VB.net 2005
Does someone please can help me to show that info in a label when it has been selected in a combobox
-
Jun 21st, 2007, 07:51 AM
#2
Re: .OCX Challenge
Create an HTML reader to pull in the source code of that page, then drop the data into a label. Piece of cake.
-
Jun 21st, 2007, 07:55 AM
#3
Re: .OCX Challenge
To download and show the information in a lable, you'd use the Net.WebClient class.
VB.Net Code:
Using wc As New Net.WebClient
Label1.Text = wc.DownloadString("http://weather.noaa.gov/pub/data/observations/metar/stations/EBBR.TXT")
End Using
-
Jun 21st, 2007, 07:57 AM
#4
Thread Starter
New Member
Re: .OCX Challenge
wow,
thx both for replying that fast!
I now will check the info
thanks!
-
Jun 21st, 2007, 08:01 AM
#5
Thread Starter
New Member
Re: .OCX Challenge
Oke it works but I have a lot of ICAO codes that can be selected in the combox. Thats why I tried this :
Dim strICAOcode As String
strICAOcode = cboMETAR.SelectedItem
Using wc As New Net.WebClient
lblMETAR.Text = wc.DownloadString("http://weather.noaa.gov/pub/data/observations/metar/stations/" & strICAOcode & ".TXT")
End Using
Now that doesn't work,the URL is wrong, is there another way to do something like this or do i need to put al the diffirent cbo options in a case ?
greets
Last edited by Commadore4eva; Jun 21st, 2007 at 08:43 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|