}//----- Form 1 Load ----- //******* Get notice ******** void GetNotice() { Directory.CreateDirectory(PathMS + "/MonitoringReports/Notes/"); Directory.CreateDirectory(PathMS + "/Temp/"); DirectoryInfo dir = new DirectoryInfo(PathMS + "/MonitoringReports/Notes/"); SaveWriter load = new SaveWriter(); if (File.Exists(PathMS + "/Temp/Rnotes.dat")) { File.Delete(PathMS + "/Temp/Rnotes.dat"); } SaveWriter save = new SaveWriter(PathMS + "/Temp/Rnotes.dat"); int k = 0; foreach (FileInfo file in dir.GetFiles("*.notesp")) { load.Destroy(); load.PathToFile = file.FullName; load.Load(); if (load.GetItemBool("Warn")) { save.AddItem("NotePath" + k, file.FullName); save.AddItem("NoteDate" + k, load.GetItem("WarnTimeDate")); k++; } } save.AddItem("Count", k); save.Save(); }
private void Form1_Load(object sender, EventArgs e) { notifyIcon1.MouseClick += notifyIcon1_MouseClick; NotifyText = notifyIcon1.Text; MinutesText = labelremtime.Text; if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "/My Spy/Block/ComputerTime.dat")) { SaveWriter save = new SaveWriter(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "/My Spy/Block/ComputerTime.dat"); save.Load(); if (save.GetItemBool("Enable")) { Time = save.GetItemInt("WarningTime"); labelremtime.Text = "" + Time + " " + MinutesText; notifyIcon1.Text = NotifyText + " " + Time + " " + MinutesText; } save.Destroy(); } else { Application.Exit(); } if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "/My Spy/Temp/shwwrn.dat")) { File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "/My Spy/Temp/shwwrn.dat"); } else { // Application.Exit(); } try { SoundPlayer player = new SoundPlayer(Properties.Resources.warning); player.Play(); }catch (Exception ex) { } try { IntPtr lHwnd = FindWindow("Shell_TrayWnd", null); SendMessage(lHwnd, WM_COMMAND, (IntPtr)MIN_ALL, IntPtr.Zero); WindowState = FormWindowState.Normal; } catch (Exception ex) { } }
private void NoteForm_Load(object sender, EventArgs e) { if (remindshow) { TopMost = true; } this.Paint += NoteForm_Paint; labelText.Text = File.ReadAllText(Path); pthspc = Path.Replace(".note", ".notesp"); save = new SaveWriter(pthspc); save.Load(); password = save.GetItemBool("Password"); tt.InitialDelay = 10; if (save.GetItemBool("Warn")) { imageButtonAlert.Visible = true; imageButtonAlert.MouseHover += PictureBoxAlert_MouseHover; } if (password) { groupBox1.Visible = true; } if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "/My Spy/Temp/FavoriteNote.dat")) { if (File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "/My Spy/Temp/FavoriteNote.dat").Equals(Path)) { FavoriteClick = true; imageButtonfavorite.normalImage = Properties.Resources.starfull; imageButtonfavorite.NormalImage = Properties.Resources.starfull; imageButtonfavorite.HoverImage = Properties.Resources.starfullhover; imageButtonfavorite.ClickImage = Properties.Resources.starfullclick; } } }
private void AddNote_Load(object sender, EventArgs e) { if (Edit) { SaveWriter save = new SaveWriter(SPath); save.Load(); richTextBox1.Text = File.ReadAllText(Path); this.Text = ResourcesFiles.ProgramStrings.EditNote; button2.Text = ResourcesFiles.ProgramStrings.EditNote; this.Icon = Properties.Resources.noteediticon; dateTimePicker1.Value = DateTime.Parse(save.GetItem("WarnTimeDate")); dateTimePicker2.Value = DateTime.Parse(save.GetItem("WarnTimeDate")); Createdate = DateTime.Parse(save.GetItem("DateofCreate")); checkBox1.Checked = save.GetItemBool("Warn"); checkBox2.Checked = save.GetItemBool("Password"); save.Clear(); //dateTimePicker1.Value = DateTime.Parse(save.GetItem("WarnTimeDate")); } }
//informations private void imageButton4_Click(object sender, EventArgs e) { string warnstr = ""; if (save.GetItemBool("Warn")) { warnstr = Environment.NewLine + ResourcesFiles.ProgramStrings.RemindDate + " - " + save.GetItem("WarnTimeDate"); } MessageBox.Show(ResourcesFiles.ProgramStrings.CreatedDate + " - " + save.GetItem("DateofCreate") + Environment.NewLine + ResourcesFiles.ProgramStrings.ModifyDate + " - " + save.GetItem("DateofEdit") + Environment.NewLine + ResourcesFiles.ProgramStrings.IsProtected + " - " + HelpClass.BoolToYesNo(save.GetItemBool("Password")) + Environment.NewLine + ResourcesFiles.ProgramStrings.Remind + " - " + HelpClass.BoolToYesNo(save.GetItemBool("Warn")) + warnstr , ResourcesFiles.ProgramStrings.Informations); }
private void Form1_Load(object sender, EventArgs e) { if (!File.Exists(PathMS + "/Settings/chat.dat")) { MessageBox.Show("Login or register to continue.", "Not logged in"); RegisterLoginForm frm = new RegisterLoginForm(); frm.Show(); } else { SaveWriter save = new SaveWriter(PathMS + "/Settings/chat.dat"); save.Load(); string usr = save.GetItem("Username"); string pass = encryptpass.DecryptString(save.GetItem("Password"), "1cPOnaLrV2MusS4Cq3aU6dja"); Administrator = save.GetItemBool("Admin"); if (Administrator) { label1.Visible = true; } if (Administrator) { ReceiverJID = usr + "@" + XmppConnection.Server; usr = "******" + usr; } else { ReceiverJID = "Admin_" + usr + "@" + XmppConnection.Server; } //connection.Login(usr, pass); //connection.Connect(); connection.ConnectToXMPPIM(usr, pass); /* * XmppIm xmppim = new XmppIm("", "", ""); * xmppim;*/ //Debug.WriteLine(connection.GetXmppClient().Authenticated); //Debug.WriteLine(connection.IsConnected()); Debug.WriteLine("Connected as " + connection.GetXmppIm().Jid); connection.GetXmppIm().Message += Connection_Message; Debug.WriteLine("Size: " + connection.Rostersize()); connection.AddToRoster(ReceiverJID); connection.GetXmppIm().RequestSubscription(ReceiverJID); connection.ApproveRequest(ReceiverJID); connection.GetXmppIm().Status += Connection_Status; Debug.WriteLine("ReceiverJID: " + ReceiverJID); } /* * RegisterLoginForm frm = new RegisterLoginForm(); * frm.Show(); */ }
//********* ONSTART *********** protected override void OnStart(string[] args) { DebugService.Write("******* " + DateTime.Now + " ********"); DebugService.Write("Start"); //nacitaju sa nastavenia MonApp = bool.Parse((string)registry.GetValue("MonitorApplications", "False")); Keylogger = bool.Parse((string)registry.GetValue("Keylogger", "False")); StatsEn = bool.Parse((string)registry.GetValue("Statistics", "True")); Internet = bool.Parse((string)registry.GetValue("Internet", "False")); DebugService.Write("Monitoring Applications: " + MonApp + " Keylogger: " + Keylogger + " Statistics: " + StatsEn); day = (short)DateTime.Now.Day; RestartD = DateTime.Now.Day; //kazdych 5 minut timer1 = new System.Timers.Timer(); timer1.Elapsed += new ElapsedEventHandler(OnTimer1_Tick); timer1.Interval = 300000; timer1.Enabled = true; //kazdu minutu timer2 = new System.Timers.Timer(); timer2.Elapsed += new ElapsedEventHandler(OnTimer2_Tick); timer2.Interval = 60000; timer2.Enabled = true; //timer pre odosielanie dat na Web - 20 minut timerWeb = new System.Timers.Timer(); timerWeb.Elapsed += new ElapsedEventHandler(OnTimerWeb_Tick); timerWeb.Interval = 1200000; timerWeb.Enabled = true; if (File.Exists(PathMS + "/Temp/ExpiredTime.dat")) { short TimeDay = short.Parse(File.ReadAllText(PathMS + "/Temp/ExpiredTime.dat")); if (TimeDay == day) { ShutDownVerify = true; ApplicationLoader.PROCESS_INFORMATION procInfo; ApplicationLoader.StartProcessAndBypassUAC(AppDomain.CurrentDomain.BaseDirectory + "/Apps/VerifyUser.exe", out procInfo); } else { ShutDownVerify = false; File.Delete(PathMS + "/Temp/ExpiredTime.dat"); } } if (MonApp) { ApplicationLoader.PROCESS_INFORMATION procInfo; ApplicationLoader.StartProcessAndBypassUAC(AppDomain.CurrentDomain.BaseDirectory + "/Apps/GetRunningApplications.exe", out procInfo); LoadAppMonitoring(); } if (Keylogger || Internet) { StartWorker(); } if (StatsEn) { LoadStatistics(); } ReadNotice(); Directory.CreateDirectory(PathMS + "/Block/"); SetRemainingPCTime(); if (File.Exists(PathMS + "/Block/BlockApps.dat")) { SaveWriter set = new SaveWriter(PathMS + "/Block/BlockApps.dat"); set.Load(); BlockApps = set.GetItemBool("Enabled"); for (int i = 0; i < set.GetItemInt("Count"); i++) { blockapplist.Add(set.GetItem("Pr" + i)); } } DebugService.Write("PCTime: " + PCTime); client.BaseAddress = new Uri("http://myspy.diodegames.eu"); Newtonsoft.Json.Serialization.DefaultContractResolver dcr = new Newtonsoft.Json.Serialization.DefaultContractResolver(); dcr.DefaultMembersSearchFlags |= System.Reflection.BindingFlags.NonPublic; jss.ContractResolver = dcr; }
void SetRemainingPCTime() { if (!ShutDownVerify) { bool custommaxtimepc = false; if (File.Exists(PathMS + "/Block/RemTime.dat")) { save = new SaveWriter(PathMS + "/Block/RemTime.dat"); save.Load(); if (save.GetItemInt("Day") == DateTime.Now.Day) { MaxTimePC = save.GetItemInt("Time"); custommaxtimepc = true; } else { File.Delete(PathMS + "/Block/RemTime.dat"); } } if (File.Exists(PathMS + "/Block/ComputerTime.dat")) { SaveWriter save = new SaveWriter(PathMS + "/Block/ComputerTime.dat"); save.Load(); if (save.GetItemBool("Enable")) { PCTime = true; DateTime time = DateTime.Parse(save.GetItem("Time")); if (!custommaxtimepc) { MaxTimePC = (time.Hour * 60) + time.Minute; } warning = save.GetItemBool("Warning"); warningtime = save.GetItemInt("WarningTime"); if (MaxTimePC <= 1) { if (File.Exists(PathMS + "/Temp/ExpiredTime.dat")) { File.Delete(PathMS + "/Temp/ExpiredTime.dat"); } File.WriteAllText(PathMS + "/Temp/ExpiredTime.dat", "" + DateTime.Now.Day); PCTime = false; ShutDownVerify = true; ApplicationLoader.PROCESS_INFORMATION procInfo; ApplicationLoader.StartProcessAndBypassUAC(AppDomain.CurrentDomain.BaseDirectory + "/Apps/VerifyUser.exe", out procInfo); } } save.Destroy(); } else { PCTime = false; } } }
private void backgroundWorkerWeather_DoWork(object sender, DoWorkEventArgs e) { try { bool showw = bool.Parse(HelpClass.GETHtml("http://myspy.diodegames.eu/ShowWeather.txt")); if (showw) { SaveWriter Loc = new SaveWriter(PathMS + "/Temp/location.dat"); Loc.Load(); string Latitude = "", Longtitude = "", CityName = ""; Latitude = Loc.GetItem("Latitude"); Longtitude = Loc.GetItem("Longtitude"); CityName = Loc.GetItem("City"); if (File.Exists(PathMS + "/Temp/weather.dat")) { SaveWriter save = new SaveWriter(PathMS + "/Temp/weather.dat"); save.Load(); if (save.GetItemInt("Day") != DateTime.Now.Day || DateTime.Now.Hour >= save.GetItemInt("Hour") + 3) { Debug.WriteLine("New Weather: Day: " + save.GetItemInt("Day") + " Hour: " + save.GetItemInt("Hour")); NewWeather(Latitude, Longtitude, CityName); } else { Debug.WriteLine("Weather from file"); weather.weatherinfo.Temperature = save.GetItem("Temperature"); weather.weatherinfo.Cloudiness = save.GetItem("Clouds"); weather.weatherinfo.CityName = save.GetItem("City"); weathericon = (Bitmap)Bitmap.FromFile(PathMS + "/Temp/weathericon.dat"); SaveWriter wsave = new SaveWriter(PathMS + "/Temp/weathersettings.dat"); wsave.Load(); bool wunit = wsave.GetItemBool("Unit"); if (wunit) { weather.weatherinfo.TemperatureUnit = "F"; } else { weather.weatherinfo.TemperatureUnit = "C"; } backgroundWorkerWeather.ReportProgress(0, ""); } } else { Debug.WriteLine("New Weather because file not found"); NewWeather(Latitude, Longtitude, CityName); } } }catch (Exception ex) { Debug.WriteLine("" + ex); } }
//***** Nacitanie Formu private void Form1_Load(object sender, EventArgs e) { //Nacitam si vlastny font try { prfontc = new PrivateFontCollection(); prfontc.AddFontFile(AppDomain.CurrentDomain.BaseDirectory + "/Resources/font.ttf"); fontsmall = new Font(prfontc.Families[0], 14.0F); fontmedium = new Font(prfontc.Families[0], 15.0F); font = new Font(prfontc.Families[0], 18.0F); fontbig = new Font(prfontc.Families[0], 26.0F); } catch (Exception ex) { Debug.WriteLine(ex); fontsmall = new Font(label1.Font.FontFamily, 14.0F); fontmedium = new Font(label1.Font.FontFamily, 15.0F); font = new Font(label1.Font.FontFamily, 18.0F); fontbig = new Font(label1.Font.FontFamily, 26.0F); } try { if (registry == null) { Process.Start(AppDomain.CurrentDomain.BaseDirectory + "/Apps/Welcome.exe"); Application.Exit(); } else { if (registry.GetValue("Properties", null) == null) { Process.Start(AppDomain.CurrentDomain.BaseDirectory + "/Apps/Welcome.exe"); Application.Exit(); } } }catch (Exception ex) { Debug.WriteLine("" + ex); Application.Exit(); } pictureBox3.MouseEnter += PictureBox3_MouseEnter; pictureBox3.MouseLeave += PictureBox3_MouseLeave; pictureBox4.MouseEnter += PictureBox4_MouseEnter; pictureBox4.MouseLeave += PictureBox4_MouseLeave; pictureBox5.MouseDown += PictureBox5_MouseDown; pictureBox5.MouseUp += PictureBox5_MouseUp; ImageList tabimage = new ImageList(); tabimage.Images.Add("img1", Properties.Resources.home); tabimage.Images.Add("img2", Properties.Resources.login); tabimage.Images.Add("img3", Properties.Resources.task); tabControl1.ImageList = tabimage; tabControl1.TabPages[0].ImageKey = "img1"; tabControl1.TabPages[1].ImageKey = "img3"; tabControl1.TabPages[2].ImageKey = "img2"; label2.Font = fontbig; button1.Font = font; backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged); backgroundWorkerWeather.ProgressChanged += new ProgressChangedEventHandler(BackgroundWorkerWeather_ProgressChanged); try { if (File.Exists(PathMS + "/Temp/secure.pas")) { File.Delete(PathMS + "/Temp/secure.pas"); } } catch (Exception exc) { Debug.WriteLine(exc); } AddNotesToPanel(); backgroundWorkerWeather.RunWorkerAsync(); textBoxPassword.KeyDown += new KeyEventHandler(TextBoxPassword_KeyPress); new Thread(() => { Thread.CurrentThread.IsBackground = true; try { if (File.Exists(PathMS + "/Temp/FavoriteNote.dat")) { string pathn = File.ReadAllText(PathMS + "/Temp/FavoriteNote.dat"); string shorttext = ""; using (StreamReader str = new StreamReader(pathn)) { for (int i = 0; i < 91; i++) { int ch = str.Read(); if (str.EndOfStream) { break; } shorttext += (char)ch; } } noteMain.SetNoteText(shorttext); noteMain.Tag = pathn; noteMain.Click += new EventHandler(this.Note_Click); this.Invoke((MethodInvoker) delegate { panelNote.Visible = true; }); } if (File.Exists(PathMS + "/Block/BlockApps.dat")) { SaveWriter set = new SaveWriter(PathMS + "/Block/BlockApps.dat"); set.Load(); if (set.GetItemBool("Enabled")) { set.Destroy(); set.PathToFile = PathMS + "/Block/RemTime.dat"; if (File.Exists(PathMS + "/Block/RemTime.dat")) { set.Load(); int timerem = set.GetItemInt("Time"); int hrs = 0, mns = 0; if (timerem > 0) { hrs = (int)Math.Floor((decimal)(timerem / 60)); mns = (timerem - (hrs * 60)); } this.Invoke((MethodInvoker) delegate { panelRemTime.Visible = true; if (timerem > 0) { labelRemTime.Text = hrs.ToString("00") + ":" + mns.ToString("00"); } }); } } } if (bool.Parse("" + registrysettings.GetValue("Statistics", false))) { if (File.Exists(PathMS + "/Stats/Today.sts")) { SaveWriter svs = new SaveWriter(PathMS + "/Stats/Today.sts"); svs.Load(); string time = svs.GetItemInt("Hours").ToString("00") + ":" + svs.GetItemInt("Mins").ToString("00"); svs.Destroy(); bool month = false; string monthav = ""; if (File.Exists(PathMS + "/Stats/Month.sts")) { month = true; svs.PathToFile = PathMS + "/Stats/Month.sts"; svs.Load(); int avgh = ((svs.GetItemInt("Hours") * 60) + svs.GetItemInt("Mins")) / svs.GetItemInt("Divide"); int hour = (int)Math.Floor((decimal)(avgh / 60)); int minutes = (avgh - (hour * 60)); monthav = hour.ToString("00") + ":" + minutes.ToString("00"); svs.Destroy(); } this.Invoke((MethodInvoker) delegate { panelTime.Visible = true; label8.Text = time; label10.Text = monthav; }); } } }catch (Exception ex) { Debug.WriteLine("" + ex); } }).Start(); //koniec threadu if (File.Exists(PathMS + "/Settings/chat.dat")) { longButtonchat.Visible = true; } bool keylogger = false; try { keylogger = bool.Parse((string)registrysettings.GetValue("Keylogger", "false")); } catch { keylogger = false; } panel3.Visible = keylogger; label4.Font = fontmedium; labelRemTime.Font = fontsmall; label5.Font = font; label8.Font = fontsmall; label9.Font = font; label10.Font = fontsmall; label11.Font = fontmedium; }//----- Form 1 Load -----