110,555
社区成员
发帖
与我相关
我的任务
分享
static void Main(string[] args)
{
XmlDocument doc = new XmlDocument();
doc.Load(@"http://202.75.218.94/gateway/zfgateway.asp?customerid=151503&sdcustomno=20090922105725&ordermoney=0.01&cardno=zfk&faceno=zfk001&cardnum=tyk000000007234&cardpass=7219004606¬iceurl=http://202.75.218.94/demo/demo1/receive.asp&remarks=banana&mark=51esales&sign=4A8D49D659B3A04DF21A023705812422");
XmlNodeList list = doc.GetElementsByTagName("item");
foreach (XmlElement host in list)
{
Console.WriteLine(host.Attributes["name"].Value);
Console.WriteLine(host.Attributes["value"].Value);
}
Console.ReadLine();
}
string html = null;
WebRequest request = WebRequest.Create("http://202.75.218.94/gateway/zfgateway.asp?customerid=151503&sdcustomno=20090922105725&ordermoney=0.01&cardno=zfk&faceno=zfk001&cardnum=tyk000000007234&cardpass=7219004606¬iceurl=http://202.75.218.94/demo/demo1/receive.asp&remarks=banana&mark=51esales&sign=4A8D49D659B3A04DF21A023705812422");
// If required by the server, set the credentials.
request.Credentials = CredentialCache.DefaultCredentials;
// Get the response.
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// Get the stream containing content returned by the server.
Stream dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Display the content.
html = responseFromServer;
// Cleanup the streams and the response.
reader.Close();
dataStream.Close();
response.Close();