예제 #1
0
        private void wB_DocumentCompleted(object ss, WebBrowserDocumentCompletedEventArgs e)
        {
            //$(".btnPopup a").click();
            //Thread.Sleep(5000);
            WebBrowser w = ss as WebBrowser;

            //
            if (!my.is_string_like(w.DocumentText, "3wa3wa"))
            {
                w.DocumentText += @"                            
                            <script src='https://3wa.tw/inc/javascript/jquery/jquery-1.8.3.min.js'></script>
                            <script>
                                //3wa3wa
                                $('.btnPopup').click();
                            </script>
                    ";
            }
            //w.Document.InvokeScript("eval", new string[] {
            //    "(function(){window.onload=function(){setInterval(function(){$('.btnPopup a').remove();},3000);};");
            //runSC("setInterval(function(){$('.btnPopup').click();},3000);");
            Console.WriteLine("Done....XD");
        }
예제 #2
0
        private void save_btn_Click(object sender, EventArgs e)
        {
            int           items            = CC.m_data.Count - 1;
            string        message          = "";
            List <string> CBoxs            = new List <string>();
            List <string> CBoxs_minus_plus = new List <string>();

            foreach (Control ta in GBox.Controls)
            {
                if (ta is ComboBox && my.is_string_like(ta.Name, "選刀"))
                {
                    ComboBox ctl = ta as ComboBox;
                    if (ctl.SelectedIndex == 0)
                    {
                        message += "請先選擇...";
                        break;
                    }
                    CBoxs.Add("M6T" + ctl.SelectedIndex);
                }
                if (ta is ComboBox && my.is_string_like(ta.Name, "正負"))
                {
                    ComboBox ctl = ta as ComboBox;
                    if (ctl.SelectedIndex == 0)
                    {
                        message += "請先選擇...";
                        break;
                    }
                    string minus_plus = "";
                    switch (ctl.SelectedIndex)
                    {
                    case 1:
                        minus_plus = "+";
                        break;

                    case 2:
                        minus_plus = "-";
                        break;
                    }
                    CBoxs_minus_plus.Add(minus_plus);
                }
            }
            if (message != "")
            {
                MessageBox.Show(message);
                return;
            }

            // 開始處理資料

            List <string> output = new List <string>();

            for (int i = 0; i < CC.m_data.Count - 1; i++)
            {
                //2020-07-14 增加處理,針對 G1 Z"數字"所有"+0.07"改為"-0.07"
                //放到 tmp 裡處理
                if (i != 0)
                {
                    string _tmp = CC.m_data[i];
                    _tmp         = _tmp.Replace("G1 Z-", "G1 Z" + CBoxs_minus_plus[i - 1].ToString());
                    _tmp         = _tmp.Replace("G1 Z+", "G1 Z" + CBoxs_minus_plus[i - 1].ToString());
                    CC.m_data[i] = _tmp;
                    //MessageBox.Show(CC.m_data[i]);
                }
                output.Add(CC.m_data[i]);
                output.Add(CBoxs[i]);
            }

            string tmp = CC.m_data[CC.m_data.Count - 1];

            tmp = tmp.Replace("G1 Z-", "G1 Z" + CBoxs_minus_plus[CBoxs_minus_plus.Count - 1]);
            tmp = tmp.Replace("G1 Z+", "G1 Z" + CBoxs_minus_plus[CBoxs_minus_plus.Count - 1]);

            CC.m_data[CC.m_data.Count - 1] = tmp;
            output.Add(CC.m_data[CC.m_data.Count - 1]);


            //for (int i = 0; i < listIndex.Count; i++)
            //{
            //    listData[listIndex[i]] = CBoxs[i];
            //}

            try
            {
                //my.file_put_contents(CC.orin_path, my.s2b(my.implode("\r\n", output)));
                File.WriteAllText(CC.orin_path, string.Join("\r\n", output.ToArray()));

                MessageBox.Show("儲存成功");
            }
            catch (Exception ex)
            {
                MessageBox.Show("儲存失敗...檔案目前被其他程式開啟了...");
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            if (args.Count() < 1)
            {
                echo(MESSAGE);
                exit();
            }
            if (my.is_string_like(args[0], "https://") || my.is_string_like(args[0], "http://"))
            {
                URL = args[0];
            }
            if (!my.is_string_like(URL, "https://") && !my.is_string_like(URL, "http://"))
            {
                echo(MESSAGE);
                exit();
            }

            string data = my.b2s(my.file_get_contents(URL));
            //echo(data);
            List <string> preScripts = new List <string>();

            //preScripts.Add("$=function(){};");
            preScripts.Add("var adsbygoogle=null;");
            //preScripts.Add("var window=null;");
            preScripts.Add("var localStorage={'getItem':function(){return '';}, 'setItem':function(a,b){} };");
            preScripts.Add("var y='46';");
            preScripts.Add("function spp(){};");
            preScripts.Add("var WWWWWTTTTTFFFFF='';");
            preScripts.Add("var document='';");
            //preScripts.Add("function $(p){};");
            preScripts.Add("function loadingpage(p){};");
            preScripts.Add("function initcomment(p){};");
            preScripts.Add("function mm(p){return (parseInt((p-1)/10)%10)+(((p-1)%10)*3)};");
            preScripts.Add("function nn(n){return n<10?'00'+n:n<100?'0'+n:n;};");
            preScripts.Add("function su(a,b,c){var e=(a+'').substring(b,b+c);return (e);};");
            preScripts.Add("function lc(l){ if (l.length != 2) return l; var az = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"; var a = l.substring(0,1); var b = l.substring(1, 2); if (a == \"Z\") return 8000 + az.indexOf(b); else return az.indexOf(a) * 52 + az.indexOf(b); };");
            preScripts.Add("function request(queryStringName){var returnValue=\"\";var URLString=new String(document.location);var serachLocation=-1;var queryStringLength=queryStringName.length;do{serachLocation=URLString.indexOf(queryStringName+\"\\= \");if (serachLocation!=-1){if ((URLString.charAt(serachLocation-1)=='?') || (URLString.charAt(serachLocation-1)=='&')){URLString=URLString.substr(serachLocation);break;}URLString=URLString.substr(serachLocation+queryStringLength+1);}}while (serachLocation!=-1)if (serachLocation!=-1){var seperatorLocation=URLString.indexOf(\" & \");if (seperatorLocation==-1){returnValue=URLString.substr(queryStringLength+1);}else{returnValue=URLString.substring(queryStringLength+1,seperatorLocation);} }return returnValue;}");
            string ch = "";

            if (!my.is_string_like(URL, "ch="))
            {
                ch = "1";
            }
            else
            {
                ch = my.explode("-", my.explode("ch=", URL)[1])[0];//第幾回
            }
            //preScripts.Add("ch=" +ch);
            //merge all scripts
            List <string> AllJS = new List <string>();
            var           mjs   = my.explode("<script>", data);

            for (int i = 6; i < mjs.Count(); i++)
            {
                var _m = my.explode("</script>", mjs[i]);
                AllJS.Add(_m[0]);
            }
            //var mScripts = my.explode("<script>", data)[7];
            //string scripts = my.explode("</script>", mScripts)[0].Trim();
            string scripts = my.implode("\n\n ", AllJS);

            scripts = scripts.Replace("var pi=ch", "ch=" + ch + ";var pi=ch");
            //scripts = scripts.Replace("\n", " ").Replace("\r", " ");
            //echo("\nCounts:" + my.explode("<script>", data).Count().ToString() + "\n");
            //echo(scripts);
            //exit();
            scripts = scripts.Replace("document.getElementById(e)", "e");

            scripts = scripts.Replace("}var", "};var");
            //scripts = scripts.Replace("ge('TheImg').src=", "WWWWWTTTTTFFFFF=");
            scripts = scripts.Replace(").src=", ");WWWWWTTTTTFFFFF=");
            //scripts = scripts.Replace(";", ";\n");
            //scripts = scripts.Replace(";", ";\n");
            //scripts = scripts.Replace("adsbygoogle", "//adsbygoogle");
            preScripts.Add(scripts);
            preScripts.Add("ps+\"___\"+\"https:\"+WWWWWTTTTTFFFFF;");


            //preScripts.Add("swtvv;");
            string sc = my.implode("\n", preScripts);

            sc = sc.Replace("; ", "; \n");
            sc = sc.Replace("(adsbygoogl", "//(adsbygoogl");
            //echo(sc);
            //exit();

            sc = sc.Replace("if (localStorage.getItem(\"imgmode\")" + my.get_between(sc, "if (localStorage.getItem(\"imgmode\")", "document.getElementById(\"barcodeimg\");"), "");
            sc = sc.Replace("document.writeln(\"<scr" + my.get_between(sc, "document.writeln(\"<scr", "ipt>\");") + "ipt>\");", "");
            sc = sc.Replace("document.writeln(\"<scr" + my.get_between(sc, "document.writeln(\"<scr", "ipt>\");") + "ipt>\");", "");
            sc = sc.Replace("document.getElementById(\"barcodeimg\");", "");
            sc = sc.Replace("(function() {" + my.get_between(sc, "(function() {", "})();") + "})();", "");

            //my.file_put_contents("sc.txt", sc);
            string finalData = EvalJScript(sc).ToString().Trim();
            //echo(sc);
            //echo(finalData);
            //exit();
            var    m      = my.explode("___", finalData);
            int    pages  = Convert.ToInt32(m[0]);
            string output = "Totals:" + pages.ToString() + "\n";
            string t      = m[1].Replace("/001_", "/{PAGE}_");

            //echo(t);
            //exit();
            for (int i = 1; i <= pages; i++)
            {
                //取得 WWWWWTTTTTFFFFF=...... 至 '.jpg';
                //WWWWWTTTTTFFFFF='//img'+su(yvdnl, 0, 1)+'.8comic.com/'+su(yvdnl,1,1)+'/'+ti+'/'+iyjco+'/'+ nn(p)+'_'+su(qvjme,mm(p),3)+'.jpg';
                //string d = t.Replace("{PAGE}", i.ToString().PadLeft(3, '0'));
                //output += d + "\n";
                var imgPath = "\"https:\"+" + my.get_between(sc, ";WWWWWTTTTTFFFFF=", ";");
                //echo(imgPath);
                //exit();
                var _sc = sc + "\n" + imgPath.Replace("(p)", "(" + i + ")") + ";";
                output += EvalJScript(_sc).ToString() + "\n";
            }
            echo(output);
        }