代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Windows.Forms;
using System.Net;
namespace shy
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }       private void button1_Click(object sender, EventArgs e)
        {
           WebClient a = new WebClient();
           string c = "http://patft.uspto.gov/netacgi/nph-Parser?";
           string b = a.DownloadString(c);
           MessageBox.Show(b);                  
        
        }运行后出现错误为:服务器提交了协议冲突. Section=ResponseStatusLine为什么?    
请高手指导

解决方案 »

  1.   

    代码有误重发一遍
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Text;
    using System.Windows.Forms;
    using System.Net;
    namespace shy
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }       private void button1_Click(object sender, EventArgs e)
            {
               WebClient a = new WebClient();
               string c = "http://patft.uspto.gov/netacgi/nph-Parser?";
               string b = a.DownloadString(c);
               MessageBox.Show(b);                  
            
            }
        }
    }
      

  2.   

    可以试下 HttpWebReuqest 和 HttpWebResponse 更底层的话就用socket发HTTP数据报吧.
      

  3.   

    服务器那头没有返回 http 200 OK, 而是返回了错误号难道你自己不用浏览器试试 url?
      

  4.   

    大家好:
    我试了试,用浏览器能返回信息,用webbrowse能得到信息,但效率低,不能用多线程处理用HttpWebReuqest 和 HttpWebResponse  出现同样错误
    用a.DownloadData(c); 出现同样错误
      

  5.   

    在string c = "http://patft.uspto.gov/netacgi/nph-Parser?";前加一个@