Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string loginUrl = this.textBox1.Text;

            if (string.IsNullOrEmpty(loginUrl))
            {
                MessageBox.Show("请填写URL");
                return;
            }
            string          sendcontent = this.textBox3.Text;
            HttpWebResponse response    = HttpUtility.CreatePostHttpResponse(loginUrl, sendcontent, 120 * 1000, "", Encoding.UTF8, null);

            using (Stream stream = response.GetResponseStream())
            {
                StreamReader sr      = new StreamReader(stream, Encoding.UTF8);
                string       content = sr.ReadToEnd();
                sr.Close();
                this.textBox2.Text = content;
            }
        }