微软的MSDN里面就有,详情见 .NET Framework 类库   HttpStatusCode 枚举

解决方案 »

  1.   

    关键是要显示错误类型而不是简单的500错误 HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("http://www.donghualvyou.com/detail/detail.asp?id=751'"); 
    // Sends the HttpWebRequest and waits for the response.            

    try
    {
    HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); 
    Stream receiveStream = myHttpWebResponse.GetResponseStream();
    Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
    // Pipes the stream to a higher level stream reader with the required encoding format. 
    StreamReader readStream = new StreamReader( receiveStream, encode );
    this.richTextBox1.Text+="\r\nResponse stream received.";
    Char[] read = new Char[256];
    // Reads 256 characters at a time.    
    int count = readStream.Read( read, 0, 256 );
    this.richTextBox1.Text+="HTML...\r\n";
    while (count > 0) 
    {
    // Dumps the 256 characters on a string and displays the string to the console.
    String str = new String(read, 0, count);
    this.richTextBox1.Text+=str;
    count = readStream.Read(read, 0, 256);
    }

    // Releases the resources of the response.
    myHttpWebResponse.Close();
    // Releases the resources of the Stream.
    readStream.Close();
    }
    catch(System.Net.WebException aa)
    {
    this.richTextBox1.Text+=aa.Message; }

    // Gets the stream associated with the response.
    这样的代码只会显示500错误
      

  2.   

    说明白了就是
    catch(System.Net.WebException aa)
    {
    this.richTextBox1.Text+=aa.Message;
    }
    这个只显示内部服务器599错误而不是显示关闭了HTTP友好信息的
    ADODB.Field error '800a0bcd' Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. /detail/detail.asp, line 10 
      

  3.   

    HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("http://www.donghualvyou.com/detail/detail.asp?id=751'"); 如果需要用户名和密码等登陆以后才可以访问的地址
    参考--
    利用HttpRequest登录到某个网站,然后获取网站信息的程序示例:
    http://news.dvbbs.net/infoview/Article_2776.html
    利用CookieContainer类实现
      

  4.   

    不是这个意思
    我的意思是
    HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("http://www.donghualvyou.com/detail/detail.asp?id=751"); 
    try
    {
    HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); 
    Stream receiveStream = myHttpWebResponse.GetResponseStream();
    Encoding encode = System.Text.Encoding.GetEncoding("GB18030");
    StreamReader readStream = new StreamReader( receiveStream, encode );
    this.richTextBox1.Text=readStream.ReadToEnd();
    myHttpWebResponse.Close();
    readStream.Close();
    }
    catch(System.Net.WebException aa)
    {
    this.richTextBox1.Text=aa.Message;
    }

    这段代码在显示正确的时候能够显示源代码但是500错误的时候只是显示500错误也就是HTTPP友好错误信息,我怎么能得到实际得错误信息,也就是关闭了HTTP友好错误信息时候的东西呢
    比如ADODB.Field error '800a0bcd' Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. /detail/detail.asp, line 10