Hallo,
ich versuche unter VB 2010 für Windows Phone(!) eine Antwort von einem Webservice in einen String zu laden. Doch irgendwie gelingt es mir nicht, meine VB 2008 Klasse zu nutzen. Ich bekomme als Fehlermeldung immer:
Error 1 'GetResponse' is not a member of 'System.Net.HttpWebRequest'.
ich versuche unter VB 2010 für Windows Phone(!) eine Antwort von einem Webservice in einen String zu laden. Doch irgendwie gelingt es mir nicht, meine VB 2008 Klasse zu nutzen. Ich bekomme als Fehlermeldung immer:
Error 1 'GetResponse' is not a member of 'System.Net.HttpWebRequest'.
VB.NET-Quellcode
- Public Class clsDownload
- Public Shared Function fetchUrls(ByVal sURL As String) As String
- Dim oHttpWebRequest As System.Net.HttpWebRequest
- Dim oStream As System.IO.Stream
- Dim sTemp As String
- oHttpWebRequest = (System.Net.HttpWebRequest.Create(sURL))
- Dim oHttpWebResponse As System.Net.WebResponse = oHttpWebRequest.GetResponse
- oStream = oHttpWebResponse.GetResponseStream
- sTemp = System.Text.RegularExpressions.Regex.Replace(New System.IO.StreamReader(oStream).ReadToEnd(), "<[^>]*>", "")
- oStream.Close()
- oHttpWebResponse.Close()
- Return sTemp
- End Function
- End Class
- Dim meinstring As String
- meinstring = clsDownload.fetchUrls("http://bing.com")