分类: 系统运维
2009-08-20 01:28:13
string strUrl = this.strURL+"?UserName="+this.urlUserName+"&Passwd="+this.urlPasswd+"&textfield="+this.urlStockCode;
//获取远程数据***********************************************************************************
System.Net.NetworkCredential myCred=null;
if(this.sProxyDomain=="")
myCred=new System.Net.NetworkCredential(this.sProxyUser,this.sProxyPwd);
else
myCred=new System.Net.NetworkCredential(this.sProxyUser,this.sProxyPwd,this.sProxyDomain);
System.Net.WebProxy proxyObject = new System.Net.WebProxy(");
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(@strUrl);
req.Proxy = proxyObject;
HttpWebResponse HttpWResp = (HttpWebResponse)req.GetResponse();
//*************************************获取远程数据******************************************************
// WebClient client = new WebClient();
// Byte[] responseData =
// client.DownloadData(@");
//
// string stockXML = System.Text.Encoding.Default.GetString(responseData).Replace("\r\n","");
// DataSet ds = new DataSet();
// System.Xml.XmlTextReader oXmlReader = new XmlTextReader(new System.IO.StringReader(stockXML));
// ds.ReadXml(oXmlReader);
DataSet ds = new DataSet();
ds.ReadXml(HttpWResp.GetResponseStream());