Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Get_EANInfo(string Str_EAN, string Str_ID)
- {
- string Str_LMWURL = ("http://opengtindb.org/?ean=" + Str_EAN + "&cmd=query&queryid=" + Str_ID);
- this.label1.Text = Str_LMWURL; // URL als ganzes
- WebRequest WebRequest_Request = WebRequest.Create(Str_LMWURL);
- WebRequest_Request.Credentials = CredentialCache.DefaultCredentials;
- HttpWebResponse HttpWebResponse_Response = (HttpWebResponse)WebRequest_Request.GetResponse();
- // Ausgabe
- this.richTextBox1.AppendText(HttpWebResponse_Response.StatusDescription + "\r"); //RichtextBox
- // Stream
- Stream Stream_DataStream = HttpWebResponse_Response.GetResponseStream();
- StreamReader StreamReade_Reader = new StreamReader(Stream_DataStream);
- // Read data
- string Str_ResponseFromServer = StreamReade_Reader.ReadToEnd();
- this.richTextBox1.AppendText(Str_ResponseFromServer + "\r"); //RichtextBox
- // Close
- StreamReade_Reader.Close();
- Stream_DataStream.Close();
- HttpWebResponse_Response.Close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement