日期:2014-05-18  浏览次数:20463 次

【【WebRequest】】 请求,在线等!!!!!!!!!!!!!!!!!!
mapdata   +=   " <?xml   version=\ "1.0\ "   encoding=\ "gb2312\ "   ?> ";
.......
string   path= " ";
path=Server.MapPath( "XMLFile1.xml ");
byte[]       SomeBytes=new       byte[1024];      

WebRequest       req   =   WebRequest.Create         ( "http://127.0.01/lianxi/WebForm1.aspx ");    
req.Method       =       "GET ";      
req.ContentType   =     "text/html ";
XmlDocument   xmldoc1=   new   XmlDocument();    
//要发送xml的路径.    
xmldoc1.Load(path);  
SomeBytes       =       System.Text.Encoding.UTF8.GetBytes(mapdata);    
req.ContentLength       =       SomeBytes.Length;      
Stream       newStream       =     req.GetRequestStream();
newStream.Write(SomeBytes,   0,SomeBytes.Length);        
newStream.Close();      
Response.Write( "发送完毕 ");      

怎么执行到     【req.GetRequestStream();】   就包
【无法发送具有此谓词类型的内容正文。】
高手帮解答一下1!!!

------解决方案--------------------
req.Method = "POST ";

*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)

http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html