WebClient用法

            WebClient client = new WebClient();
string stockCodes = "sh601169,sz000948,sh601398,sz002114";
string zs = "s_sh000001,s_sz399001";
while (true)
{
string reply = client.DownloadString(
string.Format("http://hq.sinajs.cn/list={0}", stockCodes));
Console.WriteLine(reply);
reply = client.DownloadString(
string.Format("http://hq.sinajs.cn/list={0}", zs));
Console.WriteLine(reply + " " + DateTime.Now.ToString());
System.Threading.Thread.Sleep(5000);
}
原文地址:https://www.cnblogs.com/joe62/p/1735548.html