Ejemplo n.º 1
0
        /// <summary>
        /// 取的数量
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="row"></param>
        /// <param name="executor"></param>
        /// <returns></returns>
        public int CheckAccess(List <int> tag, int row, string executor)
        {
            var rowCheck = true;
            var rowRes   = 0;

            while (rowCheck)
            {
                Console.WriteLine("请用户【" + executor + "】输入获取火柴数量:");
                var num = Console.ReadLine();
                rowRes = Utls.ParseInt(num, -1);
                if (rowRes < 1)
                {
                    Console.WriteLine("输入数量必须大于0的整数!");
                    continue;
                }
                if (tag[row - 1] < rowRes)
                {
                    Console.WriteLine("该行火柴数不足!");
                    continue;
                }
                rowCheck = false;
            }
            return(rowRes);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 检查输入的行是否正确
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="row"></param>
        public int CheckRow(List <int> tag, string executor)
        {
            var rowCheck = true;
            var rowRes   = 0;

            while (rowCheck)
            {
                Console.WriteLine("请用户【" + executor + "】输入获取第几行火柴:");
                var row = Console.ReadLine();
                rowRes = Utls.ParseInt(row, -1);
                if (rowRes < 1 || rowRes > tag.Count)
                {
                    Console.WriteLine("输入行数有误!");
                    continue;
                }
                if (tag[rowRes - 1] <= 0)
                {
                    Console.WriteLine("该行已无火柴可取!");
                    continue;
                }
                rowCheck = false;
            }
            return(rowRes);
        }
Ejemplo n.º 3
0
        private void ScannerExploit(ThreadScanner o)
        {
            bool flag = false;

            try
            {
                Types         types = new Types();
                List <string> list  = Analizer.BuildTraject(o.URL, "'A=0", true);
                using (List <string> .Enumerator enumerator = list.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        int    num     = 0;
                        string current = enumerator.Current;
                        goto Label_004F;
Label_002A:
                        num++;
                        if (num > 5)
                        {
                            continue;
                        }
                        if (this.bckWorkerSQL.CancellationPending | !__RunningWorker)
                        {
                            return;
                        }
Label_004F:
                        this.ScannerExploitCheckDelay(o.Delay);
                        string sPostData = "";
                        string sErrDesc  = "";
                        string str       = o.HTTP.GetHTML(current, enHTTPMethod.GET, ref sPostData, null, null, false, ref sErrDesc, true);
                        if (string.IsNullOrEmpty(str))
                        {
                            goto Label_002A;
                        }
                        types = Utls.CheckSyntaxError(str);
                        switch (types)
                        {
                        case Types.None:
                        {
                            continue;
                        }

                        case Types.Unknown:
                            goto Label_00E3;

                        case Types.MsAccess:
                            goto Label_00F3;
                        }
                        goto Label_00EF;
                    }
                    goto Label_0112;
Label_00E3:
                    flag = !o.TrashUnknown;
                    goto Label_0112;
Label_00EF:
                    flag = true;
                    goto Label_0112;
Label_00F3:
                    flag = !o.TrashMsAccess;
                }
Label_0112:
                if (flag)
                {
                    this.AddURL(o.OriginalUrl, new string[] { Utls.TypeToString(types) });
                    this.__SearchSummary.Found++;
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                ProjectData.ClearProjectError();
            }
            finally
            {
                try
                {
                    Console.WriteLine("Thread Count =>" + __ThreadPoolScanner.ThreadCount);
                    this.__ThreadPoolScanner.Close(o.Thread);
                }
                catch (Exception exception2)
                {
                    ProjectData.SetProjectError(exception2);
                    ProjectData.ClearProjectError();
                }
                Application.DoEvents();
            }
        }