Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button2_Click(object sender, EventArgs e)
- {
- // this is what we are sending
- string post_data = "type=" + comboBox2.Text + "&subject=" + textBox4.Text + "&name=" + textBox3.Text + "&req=" + textBox5.Text + "&os=" + comboBox1.Text + "&overview=" + textBox7.Text + "&dlink=" + textBox8.Text;
- // this is where we will send it
- string uri = "http://localhost/poster.php";
- // create a request
- HttpWebRequest request = (HttpWebRequest)
- WebRequest.Create(uri); request.KeepAlive = false;
- request.ProtocolVersion = HttpVersion.Version10;
- request.Method = "POST";
- // turn our request string into a byte stream
- byte[] postBytes = Encoding.ASCII.GetBytes(post_data);
- request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = postBytes.Length;
- Stream requestStream = request.GetRequestStream();
- //sending it...
- requestStream.Write(postBytes, 0, postBytes.Length);
- requestStream.Close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement