Beispiel #1
0
        /// <summary>
        /// Default Constructor for frm_main. This is the place to set all initial control values, etc.
        /// </summary>
        public frm_main()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // Set all controls to parameters passed on command line.
            txt_output.Text     = PARAMETERS.resultsFile;
            cb_append.Checked   = PARAMETERS.append;
            txt_path.Text       = PARAMETERS.path;
            txt_fileFilter.Text = PARAMETERS.file;
            txt_cmdFile.Text    = PARAMETERS.cmdFile;
            txt_exclusion.Text  = PARAMETERS.exclusionFile;

            // Load exclusions file
            try
            {
                rtb_exclusions.LoadFile(PARAMETERS.exclusionFile, RichTextBoxStreamType.PlainText);
            }
            catch
            {
                rtb_exclusions.Text = "";
            }

            // Create a stringcheck instance
            sc = new StringCheck();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            // Process command line
            if (true == ProcessCommandLine(args))
            {
                // Load gui
                Application.Run(new frm_main());
            }
            else
            {
                System.Windows.Forms.RichTextBox rtb_exclusions = new System.Windows.Forms.RichTextBox();
                StringCheck sc = new StringCheck();

                // Load exclusions file and process files
                try
                {
                    rtb_exclusions.LoadFile(PARAMETERS.exclusionFile, RichTextBoxStreamType.PlainText);
                }
                catch
                {
                    Console.WriteLine("ERROR - Could Not Load File {0}", PARAMETERS.exclusionFile);
                    return;
                }
                sc.Scan(PARAMETERS.path, PARAMETERS.file, rtb_exclusions.Lines, null, PARAMETERS.resultsFile, PARAMETERS.append);
            }     // if
        }         // main