All pastes #201410 Raw Edit

Mine

public text v1 · immutable
#201410 ·published 2006-10-13 20:45 UTC
rendered paste body
               ASCIIEncoding encoding = new ASCIIEncoding();

                HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://pastebin.ca/index.php");

                webRequest.Timeout = 6000;

                webRequest.Method = "post";

                webRequest.ContentType = "application/x-www-form-urlencoded";
                string postData = "content=" + "THIS IS A TEST OF THIS SYSTEM AND DOING IT AND BLEGH";

                //your post data ^^^^^^^^^^^^^

                byte[] data = encoding.GetBytes(postData);

                webRequest.ContentLength = data.Length;

                Stream newStream = webRequest.GetRequestStream();

                newStream.Write(data, 0, data.Length);

                newStream.Close();

                HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();

                Stream responseStream = webResponse.GetResponseStream();

                string responseEncoding = webResponse.ContentEncoding.Trim();

                if (responseEncoding.Length == 0)
                {

                    responseEncoding = "us-ascii";

                }

                StreamReader responseReader = new StreamReader(responseStream, System.Text.Encoding.GetEncoding(responseEncoding));

                string answer = responseReader.ReadToEnd();
                return answer;
            }

            catch
            {

                MessageBox.Show("Could not connect to update server.");
               // ChangeMessage("No updates found.");
                return "BAD";

            }