string url = "http://localhost/wcf/Northwind.svc"; // <%
// if request("aa")="zhuye" then session("ok")="ok"
// if session("ok")="ok" then
// response.write("登录")
// else
// response.write("没有登录")
// end if
// %> string indata = "aa=ccc";
string outdata = "";
CookieContainer myCookieContainer = new CookieContainer();
//新建一个CookieContainer来存放Cookie集合
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url); //myHttpWebRequest.Headers["aa"] = "ccc";
//新建一个HttpWebRequest myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
myHttpWebRequest.ContentLength = indata.Length;
myHttpWebRequest.Method = "POST";
myHttpWebRequest.CookieContainer = myCookieContainer;
//设置HttpWebRequest的CookieContainer为刚才建立的那个myCookieContainer Stream myRequestStream = myHttpWebRequest.GetRequestStream();
StreamWriter myStreamWriter = new StreamWriter(myRequestStream, Encoding.GetEncoding("gb2312"));
myStreamWriter.Write(indata);
//把数据写入HttpWebRequest的Request流 myStreamWriter.Close();
myRequestStream.Close();这是客户端 发送的流
我服务端想得到客户端的 string indata = "aa=ccc";
string indata = "aa=ccc"; 这个无法得到!!请教
解决方案 »
- winform,如何保留session再跳转到其他页面
- asp.net双击listbox列表项后,弹出打开与保存为对话框
- 如何得到Session的剩余时间?AJAX请求会更新Session么?
- RemotingObject对象中需要使用配置文件变量时怎么处理?
- winform中连接数据库的问题,请高手帮忙!!
- C#版的处女贴, 从Delphi版转过来的, 希望兄弟们以后多多照顾...
- 【求助】简单的if条件语句 在线等 有答案马上结帖
- 如何捕获声卡上的音频信号?
- 编译错误 求助
- 如果你收到被骂的短消息,请进来一下。
- 100元 求 c#登录拍拍网源码
- HttpWebRequest 返回http 304错误码,如何处理?
myStreamWriter.Write(indata);
要得到 indata = "aa=ccc";
这样试试
post这个东西给svc?什么意思呢?
然后读取 odata 的数据的这都可以实现
这是这个例子的现在就是 我服务端那块 怎样得到它 aa 大家看下帮帮忙