Пример #1
0
        private string Login()
        {
            string jspcookie;
            string htmlInfo;

            htmlInfo  = npedi.HtmlInfoBase.GetHtmlInfo(npedi.HtmlInfoBase.LoginUrl, out jspcookie);
            jspcookie = jspcookie.Split(';')[0];// 获得cookie

            string header = "";

            byte[] b   = { };
            Bitmap img = new Bitmap(
                npedi.HtmlInfoBase.GetStreamByBytes(npedi.HtmlInfoBase.Host, npedi.HtmlInfoBase.BmpUrl, b, jspcookie, out header));//获得验证码图片


            npedi.unCodeNbYang UnCheckobj = new npedi.unCodeNbYang(img);
            string             strNum     = UnCheckobj.getPicnum(); //识别图片,取得数字信息


            string postString = npedi.HtmlInfoBase.LoginPostData(null, null, strNum);                                       // 组成Post数据

            string returnHtml = npedi.HtmlInfoBase.GetHtml(npedi.HtmlInfoBase.LoginUrl, postString, jspcookie, out header); // 登入

            return(jspcookie);
        }
Пример #2
0
        private string Login()
        {
            string jspcookie;
            string htmlInfo;

            htmlInfo = npedi.HtmlInfoBase.GetHtmlInfo(npedi.HtmlInfoBase.LoginUrl, out jspcookie);
            jspcookie = jspcookie.Split(';')[0];// 获得cookie

            string header = "";
            byte[] b = { };
            Bitmap img = new Bitmap(
            npedi.HtmlInfoBase.GetStreamByBytes(npedi.HtmlInfoBase.Host, npedi.HtmlInfoBase.BmpUrl, b, jspcookie, out header));//获得验证码图片

            npedi.unCodeNbYang UnCheckobj = new npedi.unCodeNbYang(img);
            string strNum = UnCheckobj.getPicnum();     //识别图片,取得数字信息

            string postString = npedi.HtmlInfoBase.LoginPostData(null, null, strNum);// 组成Post数据

            string returnHtml = npedi.HtmlInfoBase.GetHtml(npedi.HtmlInfoBase.LoginUrl, postString, jspcookie, out header); // 登入

            return jspcookie;
        }