Download vom Webservice in Windows Phone

  • VB.NET

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von holgi.

    Download vom Webservice in Windows Phone

    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'.


    VB.NET-Quellcode

    1. Public Class clsDownload
    2. Public Shared Function fetchUrls(ByVal sURL As String) As String
    3. Dim oHttpWebRequest As System.Net.HttpWebRequest
    4. Dim oStream As System.IO.Stream
    5. Dim sTemp As String
    6. oHttpWebRequest = (System.Net.HttpWebRequest.Create(sURL))
    7. Dim oHttpWebResponse As System.Net.WebResponse = oHttpWebRequest.GetResponse
    8. oStream = oHttpWebResponse.GetResponseStream
    9. sTemp = System.Text.RegularExpressions.Regex.Replace(New System.IO.StreamReader(oStream).ReadToEnd(), "<[^>]*>", "")
    10. oStream.Close()
    11. oHttpWebResponse.Close()
    12. Return sTemp
    13. End Function
    14. End Class
    15. Dim meinstring As String
    16. meinstring = clsDownload.fetchUrls("http://bing.com")