mehdi_RM
دوشنبه 18 شهریور 1387, 12:59 عصر
با سلام
من با اين تيكه كد مي خوام قسمت وسط صفحه هواشناسي مربوط به شهر مورد نظرم رو از سايت weather .ir در بيارم همه چيز درست پيش مي ره فقط در اين روش حروف فارسي رو بهم بر نمي گردونه !!
مي خواستم بدونم چيكار بايد كنم تا حروف فارسي هم برگشت داده بشن؟؟؟
Imports System.IO
Imports System.Net
Dim strURL As String
Dim strResult As String
Dim wbrq As HttpWebRequest
Dim wbrs As HttpWebResponse
Dim sr, readStream As StreamReader
' Set the URL (and add any querystring values)
strURL = "http://www.irimo.ir/farsi/current/index.asp?station=99300"
' Create the web request
wbrq = WebRequest.Create(strURL)
wbrq.Method = "GET"
' Read the returned data
wbrs = wbrq.GetResponse
sr = New StreamReader(wbrs.GetResponseStream)
'result = readStream.ReadToEnd();
strResult = sr.ReadToEnd.Trim
sr.Close()
' Write the returned data out to the page
Dim str, strend As String
Dim StringSearch1, StringSearch2 As Integer
str = strResult
StringSearch1 = InStr(str, "<tr><Td dir=")
StringSearch2 = InStr(str, "<form name=frm2 action=history.asp")
strend = str.Substring(StringSearch1 - 20, StringSearch2 - StringSearch1 + 10)
Response.Write(Server.HtmlDecode(strend))
مي خوام خروجيم مثل اين صفحه بشه
http://aftab.ir/portal/weather/view.php?code=40754
من با اين تيكه كد مي خوام قسمت وسط صفحه هواشناسي مربوط به شهر مورد نظرم رو از سايت weather .ir در بيارم همه چيز درست پيش مي ره فقط در اين روش حروف فارسي رو بهم بر نمي گردونه !!
مي خواستم بدونم چيكار بايد كنم تا حروف فارسي هم برگشت داده بشن؟؟؟
Imports System.IO
Imports System.Net
Dim strURL As String
Dim strResult As String
Dim wbrq As HttpWebRequest
Dim wbrs As HttpWebResponse
Dim sr, readStream As StreamReader
' Set the URL (and add any querystring values)
strURL = "http://www.irimo.ir/farsi/current/index.asp?station=99300"
' Create the web request
wbrq = WebRequest.Create(strURL)
wbrq.Method = "GET"
' Read the returned data
wbrs = wbrq.GetResponse
sr = New StreamReader(wbrs.GetResponseStream)
'result = readStream.ReadToEnd();
strResult = sr.ReadToEnd.Trim
sr.Close()
' Write the returned data out to the page
Dim str, strend As String
Dim StringSearch1, StringSearch2 As Integer
str = strResult
StringSearch1 = InStr(str, "<tr><Td dir=")
StringSearch2 = InStr(str, "<form name=frm2 action=history.asp")
strend = str.Substring(StringSearch1 - 20, StringSearch2 - StringSearch1 + 10)
Response.Write(Server.HtmlDecode(strend))
مي خوام خروجيم مثل اين صفحه بشه
http://aftab.ir/portal/weather/view.php?code=40754