Hi,
I have used the yahoo weather rss for this. They have a
weather sticker embedded in it. The address for the rss feed has a
querystring for getting the weather. In the us use your zipcode for getting
the weather. This example requires a textbox (txtZip) for entering in a
zipcode to get the weather for, webbrowser control to display the weather
sticker, and a button (btnGetWeather).
Private Sub btnGetWeather_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnGetWeather.Click
Dim sr As IO.StreamReader
Dim wc As New System.Net.WebClient
Dim strUrl As String
Dim strOut As String = ""
strUrl =
String.Format("http://xml.weather.yahoo.com/forecastrss?p={0}", txtZip.Text)
Try
sr = New IO.StreamReader(wc.OpenRead(strUrl))
Dim strHtml As String = sr.ReadToEnd
Dim x As Integer = strHtml.IndexOf("<img src")
Dim y As Integer = strHtml.IndexOf(")<br/>")
strOut = strHtml.Substring(x, y - x + 6)
sr.Close()
Catch
strOut = "<h1>Error getting weather</h1>"
Finally
WebBrowser1.DocumentText = strOut
End Try
End Sub
Ken
-----------------
"Boki" <bo******@ms21.hinet.net> wrote in message
news:OL*************@TK2MSFTNGP02.phx.gbl...
Hi All,
I am going to create a personal weather board.
It is easy to show the picutre on website ( just link the picture to
picturesbox's properties )
but I dont' know how to add some other text near by..
for example:
I can get the weather icon, but I don't know how to get the description
text...
What should I do?
Best regards,
Boki.