62,046
社区成员
发帖
与我相关
我的任务
分享
public void LoopBack()
{
string receiver = Context.Request.QueryString["receiver"];
string pswd = Context.Request.QueryString["pswd"];
string moTime = Context.Request.QueryString["moTime"];
string mobile = Context.Request.QueryString["mobile"];
string ms = Context.Request.QueryString["ms"];
string destcode = Context.Request.QueryString["destcode"];
string spCode = Context.Request.QueryString["spCode"];
string notifyTime = Context.Request.QueryString["notifyTime"];
string s = string.Join(",", new { receiver, pswd, moTime, mobile, ms, destcode, spCode, notifyTime });
Context.Response.Write(s);
}
[WebMethod]
public void LoopBack(string receiver, string pswd, string moTime, string mobile, string ms, string destcode, string spCode, string notifyTime)
{
string s = string.Join(",", new { receiver, pswd, moTime, mobile, ms, destcode, spCode, notifyTime });
Context.Response.Write(s);
}
注意在Web.config的system.web节点下加入
<webServices>
<protocols>
<add name="HttpGet"/>
</protocols>
</webServices>
否则不支持get请求
public partial class LoopBack : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string receiver = Request.QueryString["receiver"];
string pswd = Request.QueryString["pswd"];
string moTime = Request.QueryString["moTime"];
string mobile = Request.QueryString["mobile"];
string ms = Request.QueryString["ms"];
string destcode = Request.QueryString["destcode"];
string spCode = Request.QueryString["spCode"];
string notifyTime = Request.QueryString["notifyTime"];
string s = string.Join(",", new { receiver, pswd, moTime, mobile, ms, destcode, spCode, notifyTime });
//可写可不写 这里只是为了输出效果
Response.Write(s);
}
}
}