[b]通过调用网络上的webservice显示股价图:[/b]
http://webservice.webxml.com.cn/webservices/ChinaStockSmallImageWS.asmx?op=getSmallImage
调用时,将获取的图片存到本地,示例代码如下:
WebClient wc = new WebClient();
byte[] data = wc.DownloadData("http://webservice.webxml.com.cn/webservices/ChinaStockSmallImageWS.asmx/getSmallImage?theStockCode=sh601857&theImageType=1");
string filepath = Server.MapPath("./");
string partfilepaht = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + "sy.gif";
filepath = filepath + "gujia\\" + partfilepaht;
File.WriteAllBytes(filepath, data);
http://webservice.webxml.com.cn/webservices/ChinaStockSmallImageWS.asmx?op=getSmallImage
调用时,将获取的图片存到本地,示例代码如下:
WebClient wc = new WebClient();
byte[] data = wc.DownloadData("http://webservice.webxml.com.cn/webservices/ChinaStockSmallImageWS.asmx/getSmallImage?theStockCode=sh601857&theImageType=1");
string filepath = Server.MapPath("./");
string partfilepaht = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + "sy.gif";
filepath = filepath + "gujia\\" + partfilepaht;
File.WriteAllBytes(filepath, data);