public Form_spySettings() { InitializeComponent(); _spyInfo = new SpyInfo(); string thisAppPath = Path.GetDirectoryName( Assembly.GetEntryAssembly().Location); _spyAppName = "SpyApp"; string spyAppPath = thisAppPath + "\\" + _spyAppName + ".exe"; _procSpyApp = new Process(); _procSpyApp.StartInfo = new ProcessStartInfo(spyAppPath); _procSpyApp.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; _statsAppName = "SpyStats"; string statsAppPath = thisAppPath + "\\" + _statsAppName + ".exe"; _procStatsApp = new Process(); _procStatsApp.StartInfo = new ProcessStartInfo(statsAppPath); Thread spyAppStatus = new Thread(new ThreadStart(SpyAppProcStatus)); spyAppStatus.Start(); this.FormClosed += Form_spySettings_FormClosed; }
static void Main(string[] args) { SpyInfo info = new SpyInfo(); try { info.DeserializeFromString(args[0]); } catch { } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form_stats(info)); }
public Form_stats(SpyInfo info) { _spyInfo = info; //тестовый набор //_spyInfo.WhereToWriteBadProcs = "111.txt"; InitializeComponent(); AddTabs(); //Thread scanThread = new Thread(new ThreadStart(ScanFiles)); //scanThread.Start(); ScanFiles(); this.FormClosed += Form_stats_FormClosed; }
static void Main(string[] args) { try { SpyInfo info = new SpyInfo(); info.DeserializeFromString(args[0]); //тестовый набор //info.WhereToWriteProcs = "ProcsStasReport.txt"; //info.WhereToReadBadApps = "BadApps.txt"; //info.IsCloseBadApp = true; //info.WhereToWriteKeys = "KeysReport.txt"; //info.WhereToReadBadWords = "BadWords.txt"; //info.WhereToWriteWords = "BadWordsReport.txt"; // var props = typeof(SpyInfo).GetProperties(); foreach (var p in props) { Console.WriteLine(p.Name + ":" + typeof(SpyInfo).GetProperty(p.Name).GetValue(info)); } Console.WriteLine("Spy is working!"); ///тут работа spy SpyApp spyApp = new SpyApp(info); spyApp.On(); } catch (Exception ex) { Console.WriteLine("Error!"); Console.WriteLine(ex.Message); } //Console.WriteLine("Press any key to close..."); //Console.ReadLine(); }
public SpyApp(SpyInfo spyInfo) { _spyInfo = spyInfo; _badApps = new List <string>(); }