在speedway connect软件中使用.Net C#的HTTP Post
我在Speedway阅读器中使用RFID Speedway connect软件,我得到了一个HTTP Post的PHP示例,在谷歌搜索之后,我找不到.Net C#的示例。因此,我尝试在简单的asp.net应用程序[托管在IIS中]中接收来自读卡器的HTTP post响应,但我始终没有得到它 下面是我的示例代码 读取器中分配的URL为在speedway connect软件中使用.Net C#的HTTP Post,c#,.net,rfid,C#,.net,Rfid,我在Speedway阅读器中使用RFID Speedway connect软件,我得到了一个HTTP Post的PHP示例,在谷歌搜索之后,我找不到.Net C#的示例。因此,我尝试在简单的asp.net应用程序[托管在IIS中]中接收来自读卡器的HTTP post响应,但我始终没有得到它 下面是我的示例代码 读取器中分配的URL为http://MY_IP/Default.aspx 我的asp.net代码示例是: protected void Page_Load(object sender, E
http://MY_IP/Default.aspx
我的asp.net代码示例是:
protected void Page_Load(object sender, EventArgs e)
{
System.Text.StringBuilder displayValues = new System.Text.StringBuilder();
System.Collections.Specialized.NameValueCollection postedValues = Request.Form;
Label1.Text = postedValues.AllKeys.Length.ToString();
}
我的网页从未被点击过。谁能告诉我如何在C#中实现HTTP Post响应
谢谢尝试使用通用处理程序 myHandler.ashx
public class myHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
string requestStr= new StreamReader(context.Request.InputStream).ReadToEnd();
context.Response.ContentType = "application/text";
switch (context.Request.HttpMethod)
{
case "GET":
break;
case "POST":
context.Response.Write("ok");
break;
default:
break;
}
}
public bool IsReusable
{
get { return false; }
}
}