Sending page:
string strXML = "<root><a>test112</a></root>";
System.Net.WebClient wc = new System.Net.WebClient();
byte[] bs = System.Text.Encoding.Default.GetBytes(strXML);
byte[] bsReturn = wc.UploadData("http://localhost/test/webform2.aspx", bs);
string strReturn = System.Text.Encoding.Default.GetString(bsReturn);
Response.Write(strReturn);
Response.End();
Receiving page:
Protected void page_load (Object sender, eventargs E)
{
System. xml. xmldocument dom = new system. xml. xmldocument ();
Try
{
Dom. Load (request. inputstream );
System. xml. xmlnode node = Dom. selectsinglenode ("// ");
If (node! = NULL)
{
Response. Write ("nodevalue =" + node. innertext );
}
}
Catch
{
Response. Write ("an error occurred! ");
}
Response. End ();
}
WebClient condition search: http://www.google.cn/search? Complete = 1 & HL = ZH-CN & newwindow = 1 & Q = WebClient % E4 % B8 % 8B % E8 % BD & revid = 1532066579 & SA = x & OI = revisions_inline & resnum = 0 & Ct = broad-revision & Cd = 4