c#: 向后台发送消息

向后台发送消息
===========================================================

//htm,aspx

 xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
   xmlHttpReq.open('POST',xmlurl,false);
   xmlHttpReq.send(sxml);
  
   if (xmlHttpReq.status != 200)
   {
    var sText = xmlHttpReq.statusText;
    alert(sText);
   }
   else
   {
    var sText = xmlHttpReq.responseText;   
   }

//aspx.cs

byte[] byts = new byte[Request.InputStream.Length];
   Request.InputStream.Read(byts,0,byts.Length);
   
   string req = System.Text.Encoding.Default.GetString(byts);
   req=Server.UrlDecode(req);

   trace(req);


...
...
...

output="<root><req text='" + output+ "' errcode='" + errcode + "'>" +purview  + "</req></root>";
   Response.Write(output);
   Response.End(); 

你可能感兴趣的:(String,C#,byte,output)