using System;
using System.Net;
using System.Threading;
using System.IO;
namespace banyi.com
{
class GetXiaMen
{
private string url_;
public string url
{
set
{
url_=value;
}
}
public GetXiaMen(string url)
{
url_=url;
}
public void GetInfo(string url)
{
//try
//{
WebClient myClient = new WebClient();
Stream response = myClient.OpenRead(url);
response.Close();
myClient.Dispose();
//}
//catch(Exception e)
//{
// Console.WriteLine("对不起网络断线了"+ e.Message);
//}
}
public void GetInfo()
{
GetInfo(url_);
}
}
class test
{
static void Main()
{
for (int i=0;i<1000;i++)
{
GetXiaMen kk=new GetXiaMen("http://xiamen.shichang.com");
kk.GetInfo();
Console.WriteLine(i);
Thread.Sleep(1000);
}
}
}
}