0

我已经尝试过 WebClient 的 DownloadSring 和 WebRequest+Stream 来尝试抓取一个页面(这个)并从中获取原始粘贴数据。我搜遍了网络,但没有找到答案。

我有这个代码:

WebRequest request = WebRequest.Create("http://pastebin.com/raw.php?i=" +  textBox1.Text);
WebResponse response = request.GetResponse();
Stream data = response.GetResponseStream();
string pasteContent = "";
using (StreamReader sr = new StreamReader(data))
{
    pasteContent = sr.ReadToEnd();
}
new Note().txtMain.Text += pasteContent;
new Note().txtMain.Refresh();


而且我有多个表单,所以我正在编辑 Note 的txtMain文本框以添加粘贴内容,但无论我使用哪种功能,它似乎都没有返回任何内容。我知道跨表单编辑很有效,因为我有很多东西可以返回到它。

如何抓取原始数据?

非常感谢,
P

4

1 回答 1

0

下载您网站的内容没有问题。您根本不使用Node您创建的类的实例。

var note = new Note();

note.txtMain.Text += pasteContent;
note.Show();
于 2014-06-29T20:54:20.797 回答