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"; 这个无法得到!!请教

解决方案 »

  1.   

    Request.QueryString["aa"] 这个无法得到
      

  2.   

     string indata = "aa=ccc";
    myStreamWriter.Write(indata);
    要得到 indata = "aa=ccc";
      

  3.   

    string str=Request.QueryString["indata"].ToString();
    这样试试
      

  4.   

    string str=Request.QueryString["indata"].ToString(); 不行
      

  5.   


    post这个东西给svc?什么意思呢?
      

  6.   

    如果你认为应该简单直接地实现基本功能,不需要包装好多层次,那么你访问ashx之类的还比较好让人理解。你去访问svc,不知道你这样做之前是否做了必要的功课,你找到的资料是怎样post数据给svc的呢?
      

  7.   

    你是post到接口吧晕了 没这么做的
      

  8.   

    svc 是 odata 的开放数据源 接口他是先认证了登录 
    然后读取 odata 的数据的这都可以实现
      

  9.   

    svc 可以不用去理会它 就当aspx http://zhidao.baidu.com/question/76825689.html?fr=qrl&cid=869&index=1
    这是这个例子的现在就是 我服务端那块 怎样得到它 aa 大家看下帮帮忙