HTML查看器错误

时间:2011-02-11 21:31:44

标签: c#

我创建了一个html代码查看器。

这是代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;

namespace testa5ermra
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string url = UrltextBox.Text;
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            StreamReader sr = new StreamReader (response.GetResponseStream());
            richTextBox1.Text = sr.ReadToEnd();
            sr.Close();

        }
    }
}

它适用于除一个页面之外的所有网页 该页面是(http://www.sharecash.org) 任何人都可以告诉我这个页面和其他页面有什么不同 任何机构都可以给我一个代码,可以获得此页面的HTML代码 我真的搜遍了每一个地方,每个答案都会受到赞赏

2 个答案:

答案 0 :(得分:0)

下载Fiddler之类的内容,并在HttpWebRequest该网站时监控来回的HTTP消息。

编辑:然后发布您在问题中看到的内容。

答案 1 :(得分:0)

@ sugerman here

> Request Count:    1
Bytes Sent:     429 (headers:429; body:0)
Bytes Received: 6,853   (headers:438; body:6415)

ACTUAL PERFORMANCE
--------------
ClientConnected:    01:56:31.020
ClientBeginRequest: 01:56:31.027
ClientDoneRequest:  01:56:31.027
Gateway Determination:  0ms
DNS Lookup:         0ms
TCP/IP Connect:     200ms
HTTPS Handshake:    0ms
ServerConnected:    01:56:31.228
FiddlerBeginRequest:    01:56:31.228
ServerGotRequest:   01:56:31.242
ServerBeginResponse:    01:56:33.800
ServerDoneResponse: 01:56:33.800
ClientBeginResponse:    01:56:33.800
ClientDoneResponse: 01:56:33.801

    Overall Elapsed:    00:00:02.7741587

RESPONSE CODES
--------------
HTTP/200:   1

RESPONSE BYTES (by Content-Type)
--------------
text/html:  6,415
~headers~:  438

ESTIMATED WORLDWIDE PERFORMANCE
--------------
The following are VERY rough estimates of download times when hitting servers based in WA, USA.


US West Coast (Modem - 6KB/sec)
---------------
Round trip cost: 0.10s
Elapsed Time:    1.10s


Japan / Northern Europe (Modem)
---------------
Round trip cost: 0.15s
Elapsed Time:    1.15s


China (Modem)
---------------
Round trip cost: 0.45s
Elapsed Time:    1.45s


US West Coast (DSL - 30KB/sec)
---------------
Round trip cost: 0.10s
Elapsed Time:    0.10s


Japan / Northern Europe (DSL)
---------------
Round trip cost: 0.15s
Elapsed Time:    0.15s


China (DSL)
---------------
Round trip cost: 0.45s
Elapsed Time:    0.45s