Announcement

Collapse
No announcement yet.

Webrequest "ISO-8859-1"

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webrequest "ISO-8859-1"

    hänge leider bei dem Problem fest einen Webrequest mit "ISO-8859-1" zu erstellen und brauche Eure Hilfe!

    Die Daten kommen immer im UTF8 Format beim Anbieter an.
    Mein Code sieht folgendermaßen aus:

    Code:
    Dim SMSRequest As WebRequest
            Dim response As HttpWebResponse
    
            Dim dataStream As Stream
            Dim reader As StreamReader
            Dim responseFromServer As String
            Dim xml As Xml.XmlDocument 
    
     SMSRequest = WebRequest.Create(urlSMS & "&username=" & MyUsername & "&password=" & MyPw & _
                       "&type=" & holeSMSTyp(mySMSTYP) & "&from=" & from & "&to=" & Rufnummer & "&content=" & SMSText & "&test=" & Test)
    
      
                ' If required by the server, set the credentials.
                SMSRequest.Credentials = CredentialCache.DefaultCredentials
    
    
                ' Get the response.
                response = CType(SMSRequest.GetResponse(), HttpWebResponse)
                ' Display the status.
                'lblStatus.Text = (response.StatusDescription)
                ' Get the stream containing content returned by the server.
                dataStream = response.GetResponseStream()
                ' Open the stream using a StreamReader for easy access.
                reader = (New StreamReader(dataStream))
                ' Read the content.
                responseFromServer = reader.ReadToEnd()
                ' Display the content.
    
                'XML Datei initialisieren und als Datei abspeichern
                xml = New Xml.XmlDocument
                xml.LoadXml(responseFromServer)
                'XML-Datei abspeichern im Root-Verzeichnis der Installation
                xml.Save("C:\XMLSMSRequest.xml")
Working...
X