这段代码为什么老是登陆不成功,说是验证码不正确,真要命了阿
Public class HttpRec
    {
        private CookieCollection _cookCollection;
        private string _Url = "http://59.50.113.196:9080/personal/servlet/LoginServlet";
        private string _refUrl = "http://59.50.113.196:9080/personal/servlet/LoginServlet";
        private string _strErr;        public string GetCode()
        {
            HttpWebRequest rqq = (HttpWebRequest)HttpWebRequest.Create("Http://59.50.113.196:9080/security/servlet/AuthenCodeImage");
            rqq.Method = "Get";
            rqq.KeepAlive = true;
            rqq.Referer = "http://59.50.113.196:9080/personal/interfaces/hainan/index.jsp";
            if (rqq.CookieContainer == null)
            {
                rqq.CookieContainer = new CookieContainer();
            }            
            HttpWebResponse rpp = (HttpWebResponse)rqq.GetResponse();                       
            Image img = Bitmap.FromStream(rpp.GetResponseStream());
            _cookCollection = rpp.Cookies;
            //  img.Save(Environment.CurrentDirectory+"\\1.bmp",System.Drawing.Imaging.ImageFormat.Bmp);
            return ChuLiImg((Bitmap)img);
        }        public static string ChuLiImg(Bitmap img)
        {
            Rectangle[] RcArr = new Rectangle[4];
            Rectangle RC1 = new Rectangle(4, 4, 6, 9);
            Rectangle RC2 = new Rectangle(11, 4, 6, 9);
            Rectangle RC3 = new Rectangle(18, 4, 6, 9);
            Rectangle RC4 = new Rectangle(25, 4, 6, 9);
            RcArr[0] = RC1;
            RcArr[1] = RC2;
            RcArr[2] = RC3;
            RcArr[3] = RC4;
            Bitmap[] bit = new Bitmap[4];
            string CodeStr = string.Empty;
            for (int i = 0; i < 4; i++)
            {
                string str =GetImgStr(ClearBg(img), RcArr[i]);
                bit[i] = ((Bitmap)img).Clone(RcArr[i], img.PixelFormat);
                if (str == "0111111111111111100000001000000011111111")
                {
                    CodeStr += "0";
                }
                if (str == "0000000000110000011000001111111111111111")
                {
                    CodeStr += "1";
                }
                if (str == "0100000111000011100001101000110011111000")
                {
                    CodeStr += "2";
                }
                if (str == "0100000111000001100100001001000011111111")
                {
                    CodeStr += "3";
                }
                if (str == "0000011000011010011000101111111111111111")
                {
                    CodeStr += "4";
                }
                if (str == "0011100111111001110100001001000010011111")
                {
                    CodeStr += "5";
                }
                if (str == "0011111101111111100100001001000011011111")
                {
                    CodeStr += "6";
                }
                if (str == "1000000010000011100011111011110011110000")
                {
                    CodeStr += "7";
                }
                if (str == "0111011111111111100010001000100011111111")
                {
                    CodeStr += "8";
                }
                if (str == "0111100111111101100001001000010011111111")
                {
                    CodeStr += "9";
                }
            }
            return CodeStr;        }
        public static string GetImgStr(Bitmap Bigimg, Rectangle Rc)
        {
            Bitmap RCBmp = Bigimg.Clone(Rc, Bigimg.PixelFormat);
            string str = "";
            for (int w = 0; w < Rc.Width - 1; w++)
            {
                for (int h = 0; h < Rc.Height - 1; h++)
                {                    if (RCBmp.GetPixel(w, h).ToArgb() == Color.Black.ToArgb())
                    {                        str += "1";
                    }
                    else
                    {
                        str += "0";
                    }
                }
            }
            return str;
        }
        private  static Bitmap ClearBg(Image Img)
        {
            Bitmap Smallimg = new Bitmap(Img);
            for (int w = 0; w < Smallimg.Width - 1; w++)
            {
                for (int h = 0; h < Smallimg.Height - 1; h++)
                {                    if (Smallimg.GetPixel(w, h).ToArgb() < (Color.Black.ToArgb() * 0.4))
                    {                        Smallimg.SetPixel(w, h, Color.Black);
                    }
                    else
                    {
                        Smallimg.SetPixel(w, h, Color.White);
                    }
                }
            }
            return Smallimg;
        }        public string LoginWeb(string PostData)
        {
            string str=string.Empty;
            HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(_Url);//创建req
            req.Accept = "*/*"; //接受任意文件
            req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)"; // 模拟使用IE在浏览
           // req.KeepAlive = true;          
            req.Referer = "http://59.50.113.196:9080/personal/interfaces/hainan/index.jsp";
            if (req.CookieContainer == null)
            {
                req.CookieContainer = new CookieContainer();
            }
            req.CookieContainer.Add(_cookCollection);
            if (PostData != null & PostData.Length > 0)
            {
                req.Method = "POST";
                req.ContentType = "application/x-www-form-urlencoded";
                byte[] b = Encoding.Default.GetBytes(PostData);
                System.IO.Stream sw = null;
                try
                {
                    sw = req.GetRequestStream();
                    sw.Write(b, 0, b.Length);
                }
                catch (System.Exception ex)
                {
                    this._strErr = ex.Message;
                }
                finally
                {
                    if (sw != null) { sw.Close(); }
                }
            }   
            HttpWebResponse rep = null;
            System.IO.StreamReader sr = null;
            try
            {
                rep = (HttpWebResponse)req.GetResponse();
                _cookCollection = rep.Cookies;
                sr = new System.IO.StreamReader(rep.GetResponseStream(), Encoding.Default);
               str = sr.ReadToEnd();
               if(sr!=null)
               {
                sr.Close();
               }
            }
            catch(Exception e)
            { MessageBox.Show(e.Message); }            return str;
        }
    }