private void RDPOpen_Click(object sender, RoutedEventArgs e) { string buttonName = (sender as Button).Name; string m = MachineIdTextBox.Text.Replace(" ", ""); switch (buttonName) { case "Beyond": string shortName = $"{m[6]}{m[7]}".ToLower(); if (shortName.Equals("mc") || shortName.Equals("tc")) { RDPHelper.BeyondVNCHelper(m); // vnc } else { RDPHelper.BeyondJumpHelper(m); // jump connect } break; case "Goverlan": RDPHelper.GoverlanHelper(m); break; case "VNC": if (_vncOption == "GoverlanVNC") { RDPHelper.GoverlanVNCHelper(m); } else if (_vncOption == "Ultra") { RDPHelper.VNCHelper(m, vncScreenSize); } else if (_vncOption == "BeyondVNC") { RDPHelper.BeyondVNCHelper(m); } break; case "RDP": RDPHelper.RdpHelper(m); break; case "BigFix": RDPHelper.BigFixHelper(); break; default: MessageBox.Show("How did you do this?"); break; } }
private void ComputerSearch(bool doOpenConnection = false) { // clear recent results ClearDisplay(); // remove empty space and upercase the input string s = MachineIdTextBox.Text.Replace(" ", "").ToLower(); // check if machine text box has something in it. if (MachineIdTextBox.Text != null && MachineIdTextBox.Text != "") { // if s(computer)pings if (NetworkHelper.IsPingable(s)) { // resolve the dns of the computer string machineName = NetworkHelper.GetDns(s); DnsLabel.Content = machineName; char[] machine = machineName.ToCharArray(); string shortName = $"{machine[6]}{machine[7]}"; // find if computer is thin client or full client if (shortName.Equals("mc") || shortName.Equals("tc")) { UserLabel.Content = "nghspass"; if (doOpenConnection) { // get chosen vnc option string vncOption = Settings.Default.VncOption; // connect to the computer switch (vncOption) { case "Ultra": RDPHelper.VNCHelper(machineName, Settings.Default.VncScreenSize); break; case "GoverlanVNC": RDPHelper.GoverlanVNCHelper(machineName); break; case "BeyondVNC": RDPHelper.BeyondVNCHelper(machineName); break; } } } else { bgWorker.RunWorkerAsync(); // find the user background task if (doOpenConnection) { // start in chosen rdp session string rpdOption = Settings.Default.RdpOption; // automatically RDP to machine switch (rpdOption) { case "GoverlanRDP": RDPHelper.GoverlanHelper(machineName); break; case "BeyondRDP": RDPHelper.BeyondJumpHelper(machineName); break; } } } } } }