本帖最后由 hyblusea 于 2009-09-30 11:39:31 编辑

解决方案 »

  1.   

    你首先要了解FLASH了。应该是登陆后把密码和账号绑定在COOKIET,SESSION了。发送数据应该都是用Request页面了。接收的话应该是Response了
      

  2.   

    http://code.google.com/p/kaixin/downloads/listhttp://code.google.com/p/kaixin001-helper/downloads/listhttp://www.webryan.cn/2009/04/about-kaixin001-game-helper/给楼主一些链接,这些都是用.net做的开心网的外挂做参考
      

  3.   

    数据包貌似都有加密?是的话那就大概只有直接操作FLASH了,但是貌似很难……
      

  4.   

    参考
    http://topic.csdn.net/u/20090804/14/f74fdcbf-390c-4108-ad32-ecbe3cfff722_2.html
      

  5.   

    项目已经检出到本地了,但是运行报错,Utility.Login(loginEmail, loginPassword);
    这句话全部报错:非静态的字段、方法或属性“SNSHelper.Kaixin001.Utility.Login(string, string)”要求对象引用为什么没有对类实例化呢?-_- ????
      

  6.   

    5 “SNSHelper.Kaixin001.GardenHelper”不包含采用“0”参数的构造函数 D:\MY Program\kaixin001-helper\SNSHelper_UnitTest\GardenHelperTest.cs 75 35 SNSHelper_UnitTest错误太多了。解决不完崩溃
      

  7.   


    WebRequest wrt;
    wrt = WebRequest.Create("http://xiaoyou.qq.com/index.html?ref=http%3A%2F%2Fxiaoyou.qq.com%2Findex.php%3Fmod%3Dhome");
    wrt.Credentials = CredentialCache.DefaultCredentials;
    WebResponse wrp;wrp = wrt.GetResponse();string html = new StreamReader(wrp.GetResponseStream(), Encoding.UTF8).ReadToEnd();
    string cookie = wrp.Headers.Get("Set-Cookie");
    return html;
    cookie 为 null,是怎么回事呢?应该怎样获取cookie? 
      

  8.   


    protected void cookieuse()
        {
            //写入cookie
            HttpCookie cookie = new HttpCookie("Info");//定义cookie对象以及名为Info的项
            DateTime dt = DateTime.Now;//定义时间对象
            TimeSpan ts=new TimeSpan(1,0,0,0);//cookie有效作用时间,具体查msdn
            cookie.Expires = dt.Add(ts);//添加作用时间
            cookie.Values.Add("user","cxbkkk");//增加属性
            cookie.Values.Add("userid","1203");
            Response.AppendCookie(cookie);//确定写入cookie中        
            
            //读取cookie
            if(Request.Cookies["Info"]!=null)
            {
                string temp=Convert.ToString(Request.Cookies["Info"].Values["user"])+" "+Convert.ToString(Request.Cookies["Info"].Values["userid"]);       
                //读全部就用Request.Cookies["Info"].Value)
                if(temp=="")
                {
                    Response.Write("空");
                }
                else
                    Response.Write(temp);
            }
            else
            {
                Response.Write("error");
            }
            
            //修改cookie
            Response.Cookies["Info"]["user"] = "2";
            Response.Cookies["Info"].Expires = DateTime.Now.AddDays(1);        //删除cookie下的属性
            
            HttpCookie acookie=Request.Cookies["Info"];
            acookie.Values.Remove("userid");
            acookie.Expires = DateTime.Now.AddDays(1);
            Response.Cookies.Add(acookie);        //删除所有cookie,就是设置过期时间为现在就行了
            int limit=Request.Cookies.Count - 1;
            for(int i=0;i<limit;i++)
            {
                acookie = Request.Cookies[i];
                acookie.Expires = DateTime.Now.AddDays(-1);
                Response.Cookies.Add(acookie);
            }
        }
    我一般这样用
      

  9.   

    原来是我的登陆页面搞错了,应该是
    http://ui.ptlogin2.qq.com/cgi-bin/login?appid=15000102&hide_title_bar=1&qlogin_jumpname=xiaoyou_qlogin&s_url=http://xiaoyou.qq.com/index.php%3Fmod%3Dlogin&css=http://imgcache.qq.com/campus/login/login.css&self_regurl=http://xiaoyou.qq.com/emailreg.html
      

  10.   

    新问题又出现:
    public static byte[] GetHtmlByBytes(string server, string URL, byte[] byteRequest, string cookie, out string header)
            {
                long contentLength;
                HttpWebRequest httpWebRequest;
                HttpWebResponse webResponse;
                Stream getStream;            httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(URL);
                CookieContainer co = new CookieContainer();
                co.SetCookies(new Uri(server), cookie);            httpWebRequest.CookieContainer = co;            httpWebRequest.ContentType = "application/x-www-form-urlencoded";
                httpWebRequest.Accept =
                    "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
                httpWebRequest.Referer = server;
                httpWebRequest.UserAgent =
                    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)";
                httpWebRequest.Method = "Post";
                httpWebRequest.ContentLength = byteRequest.Length;
                Stream stream;
                stream = httpWebRequest.GetRequestStream();
                stream.Write(byteRequest, 0, byteRequest.Length);
                stream.Close();
                webResponse = (HttpWebResponse)httpWebRequest.GetResponse();
                header = webResponse.Headers.ToString();
                getStream = webResponse.GetResponseStream();
                contentLength = webResponse.ContentLength;  // 这里得到的是 -1             byte[] outBytes = new byte[contentLength];  // 导致这里报错
                outBytes = ReadFully(getStream);
                getStream.Close();
                return outBytes;
            }webResponse.ContentLength 值为 -1 ,高手们再帮帮忙啊!!