public void getMemoryAddr() { try { } catch (Exception ex) { CTLError.WriteError("getMemoryAddr in CTLConfig", ex.Message); return; } }
public static void GetConfiguration() { // string x = Guid.NewGuid().ToString(); XmlDocument document = new XmlDocument(); try { document.Load(Application.StartupPath + @"\Config.xml"); _port = document.SelectSingleNode("//Port").Attributes["Value"].Value; _pathfile = document.SelectSingleNode("//PathFile").Attributes["Value"].Value; } catch (Exception exception) { CTLError.WriteError("CTLConfig getconfig", exception.Message); return; throw new Exception(exception.Message); } }
public static void XoaErrorlog() { try { DirectoryInfo d = new DirectoryInfo(Application.StartupPath); foreach (FileInfo fileerr in d.GetFiles("ErrorLog*")) { DateTime ngayxoa = DateTime.Now.AddDays(-7); if (fileerr.LastWriteTime < ngayxoa) { fileerr.Delete(); } } } catch (Exception ex) { CTLError.WriteError("Loi Xoa Errorlog", ex.Message); return; } }
private void Form1_Load(object sender, EventArgs e) { try { KillALL(); if (IsRunning("Proxifier")) { ptbProxifier.Image = Properties.Resources.ProxifierOn; } else { ptbProxifier.Image = Properties.Resources.ProxifierOff; } toolTip1.SetToolTip(ptbProxifier, "On/Off Proxifier"); toolTip1.SetToolTip(ptbChange, "Left click -> Change SSH\nRight click -> Disconnect"); if (File.Exists("SSHCHANGERFREE.exe.config")) { myform2.linkssh = Properties.Settings.Default.linkssh; myform2.location = Properties.Settings.Default.location; myform2.loopssh = Properties.Settings.Default.loopssh; myform2.autosave = Properties.Settings.Default.autosave; myform2.changeby247 = Properties.Settings.Default.changeby247; myform2.changebymanual = Properties.Settings.Default.changebymanual; myform2.changebyscheduled = Properties.Settings.Default.changebyscheduled; myform2.importsshfromfile = Properties.Settings.Default.importsshfromfile; myform2.randomssh = Properties.Settings.Default.randomssh; myform2.scheduleddelay = Properties.Settings.Default.scheduleddelay; cbChangetimezone.Checked = Properties.Settings.Default.timezone; nmrPort.Value = Properties.Settings.Default.port; nmrTimeout.Value = Properties.Settings.Default.timeout; } //importsshbyfilepath = Path.Combine(Application.StartupPath, "SSH.txt"); //LoadSSH(importsshbyfilepath); DownloadFile(CTLConfig._pathfile, "SSH_DOWNLOAD.txt"); LoadSSH("SSH_DOWNLOAD.txt"); buttonChangeClick(); } catch (Exception ex) { CTLError.WriteError("Loi Form1_load ", ex.Message); } }