您的位置:首页 > 编程语言 > C#

c#: 向后台发送消息

2007-05-17 11:21 363 查看
向后台发送消息
===========================================================

//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();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: