用post方式提交数据的问题
设置了一个字典类型:
Dictionary<string,string> test = new Dictionary<string,string>();
test["sub"] = "ComMemberHandler";
test["fn"] = "Login";
test["code"] = UserNameTextBox.Text;
test["pwd"]=PasswordTextBox.Text;
设置了要访问的web服务器的url:
string UserUri = "http://192.168.1.13/RouteMap/Client/Handler.ashx";
Uri uri = new Uri(UserUri);
WebRequest request = WebRequest.Create(uri.ToString());
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
然后怎么把字典里面的值传到服务器啊?最好是有代码。。。。
[解决办法]
request["sub"] = "ComMemberHandler";
request["fn"] = "Login";
request["code"] = UserNameTextBox.Text;
request["pwd"]=PasswordTextBox.Text;
[解决办法]