private void bOK_Click(object sender, EventArgs e) { OK = true; string text = ePasswordOld.Text; int num = 0; Logeado = false; int num2 = id; if (num2 == 1) { string a = XmlConfig.X2Y(text); if (a != "0" && a == opciones.PasswordADM && opciones.PasswordADM != "" && ePasswordNew.Text == ePasswordVer.Text && ePasswordNew.Text != "") { opciones.PasswordADM = XmlConfig.X2Y(ePasswordNew.Text); num = 1; Configuracion.Access_Log("Password changed"); } } if (num == 1) { opciones.Save_Net(); MessageBox.Show("Password changed"); } Logeado = true; Close(); }
private void bOk_Click(object sender, EventArgs e) { Configuracion.Access_Log("User Kiosk changed"); opciones.Srv_Ip = tWeb.Text; opciones.Srv_User = tLogin.Text; opciones.Srv_User_P = tPassword.Text; opciones.Save_Net(); OK = true; Close(); }
private void button2_Click(object sender, EventArgs e) { if (MessageBox.Show("Turn to Windows Mode", "Stop", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } DLG_Login dLG_Login = new DLG_Login(ref opciones, 1); Application.DoEvents(); dLG_Login.Focus(); dLG_Login.ShowDialog(); int logeado = dLG_Login.Logeado; if (logeado == 1) { reboot = 1; string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); string path = folderPath + "\\Toolwiz Time Freeze 2014\\ToolwizTimeFreeze.exe"; if (File.Exists(path) && Configuracion.Freeze_Check() == 1) { Configuracion.Freeze_Build_Timestamp(); Configuracion.Freeze_Build_TimestampBoot(); Configuracion.Freeze_Off(); Configuracion.WinReset(); } else { MWin.UnLock_Windows(); try { RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon", writable: true); registryKey.SetValue("Shell", "explorer.exe", RegistryValueKind.String); registryKey.Close(); } catch { } try { RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon", writable: true); registryKey.SetValue("Shell", "explorer.exe", RegistryValueKind.String); registryKey.Close(); } catch { } Configuracion.Access_Log("Turn Windows Mode"); Configuracion.WinReset(); } } }
private static void Main() { bool flag = true; flag = false; Check_DNS(); string text = "c:\\kiosk\\Loader.exe"; string text2 = "c:\\kiosk\\_Loader.exe"; string path = "c:\\kiosk\\_Loader.exe.ver"; string path2 = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\kiosk.options.tmp"; if (File.Exists(path2)) { try { File.Delete(path2); } catch { } } flag = true; if (File.Exists(text) && File.Exists(text2) && File.Exists(path) && !FileEquals(text, text2) && Util.HashFile(text2, _create: false) && FindAndKillProcess("Loader")) { Thread.Sleep(2000); if (!FindAndKillProcess("Loader")) { try { File.Delete(text); } catch { } Thread.Sleep(1000); try { File.Copy(text2, text); } catch { } Thread.Sleep(1000); Reboot(); Thread.Sleep(10000); Application.Exit(); } } flag = true; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(defaultValue: false); Configuracion _opc = new Configuracion(); _opc.Set_AppName("kiosk".ToLower()); flag = true; if (File.Exists(_opc.CfgFileFull + ".tmp")) { try { File.Delete(_opc.CfgFileFull + ".tmp"); } catch { } } flag = true; _opc.Load_Net(); flag = true; if (_opc.Reset == 1) { flag = true; _opc.Save_Net(); } flag = true; if (_opc.MACLAN != "0") { _opc.Save_Net($"{_opc.MACLAN}", "cfg"); } flag = true; flag = false; Update_DateTime(); flag = true; if (_opc.unique) { Process[] processesByName = Process.GetProcessesByName(Assembly.GetExecutingAssembly().GetName().Name); if (processesByName.Length > 1) { return; } } Configuracion.CleanUpDisk(); string text3 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\uvnc bvba\\UltraVNC\\winvnc.exe"; if (File.Exists(text3) && Configuracion.VNC_Check_Timestamp() == 1) { Process.Start(text3, "-connect " + _opc.Server_VNC + ":5500 -run"); } flag = true; string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); string path3 = folderPath + "\\Toolwiz Time Freeze 2014\\ToolwizTimeFreeze.exe"; if (File.Exists(path3) && Configuracion.Freeze_Check() == 0 && Configuracion.Freeze_Check_Timestamp() == 0) { Configuracion.Freeze_On(); } flag = true; if (_opc.VersionPRG == "update") { Process.Start("shutdown.exe", "/r"); return; } for (int i = 0; i < 5; i++) { if (PingTest()) { break; } for (int j = 0; j < 100; j++) { Application.DoEvents(); Thread.Sleep(10); } } flag = true; if (!PingTest()) { MSGBOX_Timer mSGBOX_Timer = new MSGBOX_Timer("No INTERNET Connection. Check Network cable, network parameters or WIFI", "Ok", 5); mSGBOX_Timer.ShowDialog(); } Configuracion.Access_Log("Load Kiosk"); flag = true; if (FindWinPCapProcess() || FindVMWareProcess() || FindWiresharkProcess() || RedPill() == 1) { _opc.ForceSpy = true; } flag = true; Application.Run(new MainWindow(ref _opc)); flag = false; if (FindAndKillProcess("Loader")) { Thread.Sleep(2000); if (!FindAndKillProcess("Loader")) { RunProcess(text); Application.Exit(); } } }