110,539
社区成员
发帖
与我相关
我的任务
分享
string csh=this.txtcshu.txt
string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + ("url.txt");
StreamReader rs = File.OpenText(path);
while ((url = rs.ReadLine()) != null)
{
if (!url.Contains("http://"))
{
url = "http://" + url;
richTextBox1.Text = string.Empty;
WebClient cli = new WebClient();
string shujl = cli.DownloadString(url + cshu);
cli.Encoding = Encoding.UTF8;
cli.Headers.Add("user-agent", "Baiduspider");
Stream stream = cli.OpenRead(url + cshu);
StreamReader rd = new StreamReader(stream);
string strTemp = string.Empty;
while ((strTemp = rd.ReadLine()) != null)
{
MessageBox.Show(strTemp);
}
}
这个是我写个测试的方法 一句话一句话 输出 测试的