Clone of UAS2 @ https://github.com/drudgedance/uas2

Form1.cs 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1.  /*
  2. * This file is part of UAS2.
  3. *
  4. * UAS2 is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * UAS2 is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. * You should have received a copy of the GNU General Public License
  14. * along with UAS2; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. *
  17. * Author: blakine
  18. * Date: 10/02/2009
  19. *
  20. */
  21. using System;
  22. using System.Collections.Generic;
  23. using System.ComponentModel;
  24. using System.Data;
  25. using System.Diagnostics;
  26. using System.Drawing;
  27. using System.Linq;
  28. using System.Text;
  29. using System.Windows.Forms;
  30. namespace UAS2_launcher
  31. {
  32. public partial class frmMain : Form
  33. {
  34. public frmMain()
  35. {
  36. InitializeComponent();
  37. txtIP.Text = UAS2_launcher.Properties.Settings.Default.strIP;
  38. txtPort.Text = UAS2_launcher.Properties.Settings.Default.strPort;
  39. txtUser.Text = UAS2_launcher.Properties.Settings.Default.strUser;
  40. txtPass.Text = UAS2_launcher.Properties.Settings.Default.strPass;
  41. }
  42. private void btnExit_Click(object sender, EventArgs e)
  43. {
  44. Application.Exit();
  45. }
  46. private void chkSave_CheckedChanged(object sender, EventArgs e)
  47. {
  48. if (chkSave.Checked)
  49. {
  50. UAS2_launcher.Properties.Settings.Default.strIP = txtIP.Text;
  51. UAS2_launcher.Properties.Settings.Default.strPort = txtPort.Text;
  52. UAS2_launcher.Properties.Settings.Default.strUser = txtUser.Text;
  53. UAS2_launcher.Properties.Settings.Default.strPass = txtPass.Text;
  54. UAS2_launcher.Properties.Settings.Default.Save();
  55. }
  56. }
  57. private void btnConnect_Click(object sender, EventArgs e)
  58. {
  59. ProcessStartInfo startInfo = new ProcessStartInfo();
  60. startInfo.FileName = "client.exe";
  61. startInfo.UseShellExecute = false;
  62. startInfo.RedirectStandardOutput = true;
  63. string start = " -h " + txtIP.Text.ToString() + " -p " + txtPort.Text.ToString() + " -a " + txtUser.Text.ToString() + ":" + txtPass.Text.ToString();
  64. startInfo.Arguments = start;
  65. Process.Start(startInfo);
  66. }
  67. }
  68. }