xml==txttxt==stringstring==byte []模拟请求 发送byte []也就是发送了xml请求之后 downloaddata返回byte []byte [] ==stringstring==txttxt==xmlover

解决方案 »

  1.   

    你就Post数据过去就可以了,数据内容以xml格式#region POST提交参数
            /// <summary>
            /// POST提交参数
            /// </summary>
            /// <param name="PostUrl">POST的地址,需要传送的地址</param>
            /// <param name="Parameters">POST提交参数,例如“client_id=2866517568&client_secret=9c”和get的链接类似</param>
            /// <returns></returns>
            public static string Post(string PostUrl, string Parameters)
            {
                string content = string.Empty;
                try
                {
                    //转换为字节数组
                    byte[] bytesRequestData = Encoding.UTF8.GetBytes(Parameters);
                    //path不是登录界面,是登录界面向服务器提交数据的界面
                    HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create(PostUrl);
                    myReq.Method = "post";
                    myReq.ContentType = "application/x-www-form-urlencoded";
                    //填充POST数据
                    myReq.ContentLength = bytesRequestData.Length;
                    Stream requestStream = myReq.GetRequestStream();
                    requestStream.Write(bytesRequestData, 0, bytesRequestData.Length);
                    requestStream.Close();
                    //发送POST数据请求服务器
                    HttpWebResponse HttpWResp = (HttpWebResponse)myReq.GetResponse();
                    //获取服务器返回信息
                    Stream myStream = HttpWResp.GetResponseStream();
                    StreamReader reader = new StreamReader(myStream, Encoding.UTF8);
                    content = reader.ReadToEnd();
                    reader.Close();
                    HttpWResp.Close();
                }
                catch (Exception ex)
                {
                    content = ex.ToString();
                }
                return content;
            }
            #endregion
      

  2.   

    接收
    Stream s = HttpContext.Current.Request.InputStream;
                        byte[] b = new byte[s.Length];
                        s.Read(b, 0, (int)s.Length);
                        postStr = Encoding.UTF8.GetString(b);
                        if (!string.IsNullOrEmpty(postStr))
                        {
                            //你要的操作
                        }
      

  3.   

    说得直白点就是把xml的文本(字符串)形式post到对方指定的页面上,然后将结果采集回来
      

  4.   

    xml写在post提交参数那里么?变成字符串格式不/xml文
      

  5.   


    就比如我要吧这个xml加进去怎么办
    <?xml version="1.0" encoding="gb2312"?>
    <AutoUpdater>
      <description>Application autoUpdate</description>
      <Updater>
    <Url>http://192.168.0.103</Url>
    <LastUpdateTime>2005-09-05</LastUpdateTime>
      </Updater>
      <Application applicationId="ItemSoft">
        <EntryPoint>ItemSoft.exe</EntryPoint>
        <Location>.</Location>
        <Version>1.0.0.0</Version>
      </Application>
      <Files>
       <File Ver="1.0.0.0" Name="ItemSoft.exe" />
       <File Ver="1.0.0.0" Name="Reports\test.txt"/>
       <File Ver="1.0.0.0" Name="Interop.grproLib.dll"/>
       <File Ver="1.0.0.0" Name="Reports\test.grf"/>
      </Files>
    </AutoUpdater>
    这块真的是一点都不懂,谢谢大神了
      

  6.   

    你提交过去,对方再返回给你就好了呀
    跟Ajax查询后处理的原理类似