예제 #1
0
파일: FormMain.cs 프로젝트: imatary/work
        private void hyperlinkConfigs_Click(object sender, EventArgs e)
        {
            var configs = new FormConfigs();

            configs.ShowDialog();

            //_processName = ConfigurationManager.AppSettings["ProcessName"];
            //MessageBox.Show(_processName);

            //Ultils.WriteFile(GetValueWindowText.GetAllTextFromWindowByTitle(_processName));
            //MessageBox.Show("Write file OK");

            _path        = ConfigurationManager.AppSettings["PathInput"];
            _processName = ConfigurationManager.AppSettings["ProcessName"];
        }
예제 #2
0
파일: FormMain.cs 프로젝트: cuongpv88/work
        //private WORK_ORDER_ITEMS _workOrderItems;
        //private SCANNING_LOGS _scanningLogs;
        //private readonly WORK_ORDER_ITEMS_Service _workOrderItemService;
        //private readonly SCANNING_LOGS_Service _scanningLogsService;
        private void FormMain_Load(object sender, EventArgs e)
        {
            _path = ConfigurationManager.AppSettings["PathInput"];
            _processName = ConfigurationManager.AppSettings["ProcessName"];
            if (checkStartWatching.Checked)
            {
                try
                {
                    _mWatcher = new FileSystemWatcher();
                    if (rdbDir)
                    {
                        _mWatcher.Filter = "*.txt";
                        _mWatcher.Path = _path + "\\";
                    }
                    else
                    {
                        _mWatcher.Filter = _path.Substring(_path.LastIndexOf('\\') + 1);
                        _mWatcher.Path = _path.Substring(0, _path.Length - _mWatcher.Filter.Length);
                    }
                    checkStartWatching.ForeColor = Color.DarkGreen;
                    checkStartWatching.Text = @"Stop Watching";
                    txtBarcode.Focus();
                    if (subFolder)
                    {
                        _mWatcher.IncludeSubdirectories = true;
                    }

                    _mWatcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
                                             | NotifyFilters.FileName | NotifyFilters.DirectoryName;
                    _mWatcher.Created += new FileSystemEventHandler(OnChanged);
                    _mWatcher.Changed += new FileSystemEventHandler(OnChanged);
                    _mWatcher.EnableRaisingEvents = true;
                }
                catch (Exception)
                {
                    var configs = new FormConfigs();
                    configs.ShowDialog();
                    
                }
            }
        }
예제 #3
0
파일: FormMain.cs 프로젝트: imatary/work
        //private WORK_ORDER_ITEMS _workOrderItems;
        //private SCANNING_LOGS _scanningLogs;
        //private readonly WORK_ORDER_ITEMS_Service _workOrderItemService;
        //private readonly SCANNING_LOGS_Service _scanningLogsService;
        private void FormMain_Load(object sender, EventArgs e)
        {
            _path        = ConfigurationManager.AppSettings["PathInput"];
            _processName = ConfigurationManager.AppSettings["ProcessName"];
            if (checkStartWatching.Checked)
            {
                try
                {
                    _mWatcher = new FileSystemWatcher();
                    if (rdbDir)
                    {
                        _mWatcher.Filter = "*.txt";
                        _mWatcher.Path   = _path + "\\";
                    }
                    else
                    {
                        _mWatcher.Filter = _path.Substring(_path.LastIndexOf('\\') + 1);
                        _mWatcher.Path   = _path.Substring(0, _path.Length - _mWatcher.Filter.Length);
                    }
                    checkStartWatching.ForeColor = Color.DarkGreen;
                    checkStartWatching.Text      = @"Stop Watching";
                    txtBarcode.Focus();
                    if (subFolder)
                    {
                        _mWatcher.IncludeSubdirectories = true;
                    }

                    _mWatcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
                                             | NotifyFilters.FileName | NotifyFilters.DirectoryName;
                    _mWatcher.Created            += new FileSystemEventHandler(OnChanged);
                    _mWatcher.Changed            += new FileSystemEventHandler(OnChanged);
                    _mWatcher.EnableRaisingEvents = true;
                }
                catch (Exception ex)
                {
                    var configs = new FormConfigs();
                    configs.ShowDialog();
                }
            }
        }
예제 #4
0
파일: FormMain.cs 프로젝트: cuongpv88/work
        private void hyperlinkConfigs_Click(object sender, EventArgs e)
        {
            var configs = new FormConfigs();
            configs.ShowDialog();
            _processName = ConfigurationManager.AppSettings["ProcessName"];
            MessageBox.Show(_processName);

            Ultils.WriteFile(GetValueWindowText.GetAllTextFromWindowByTitle(_processName));
            MessageBox.Show("Write file OK");
        }