Advertisement
VMTragedy

clean code

Nov 26th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using OpenVpnManagement;
  11. using System.Diagnostics;
  12.  
  13. namespace FATNECKVPN
  14. {
  15. public partial class Hub : Form
  16. {
  17. Process openVpnProcess = new Process();
  18. public Hub()
  19. {
  20. InitializeComponent();
  21. }
  22.  
  23. private void logInButtonWithProgress2_Click(object sender, EventArgs e)
  24. {
  25. if (logInComboBox1.Text == "Los Angelos")
  26. {
  27. new System.Net.WebClient().DownloadFile("http://37.205.9.224/client.ovpn", @"C:\Program Files\OpenVPN\config\client.ovpn");
  28. openVpnProcess.StartInfo.CreateNoWindow = true;
  29. openVpnProcess.EnableRaisingEvents = true;
  30. openVpnProcess.StartInfo.Arguments = "--config client.ovpn";
  31. openVpnProcess.StartInfo.FileName = "openvpn.exe";
  32. openVpnProcess.StartInfo.WorkingDirectory = @"C:\Program Files\OpenVPN\config\";
  33. openVpnProcess.Start();
  34. logInStatusBar1.Text = new System.Net.WebClient().DownloadString("https://api.ipify.org");
  35. }
  36. else if (logInComboBox1.Text == "<Server 2 Name Here>")
  37. {
  38. new System.Net.WebClient().DownloadFile("http://websitehereyoufuckingnigger.com/config2.ovpn", @"C:\Program Files\OpenVPN\config\config2.ovpn");
  39. openVpnProcess.StartInfo.CreateNoWindow = true;
  40. openVpnProcess.EnableRaisingEvents = true;
  41. openVpnProcess.StartInfo.Arguments = "--config config2.ovpn";
  42. openVpnProcess.StartInfo.FileName = "openvpn.exe";
  43. openVpnProcess.StartInfo.WorkingDirectory = @"C:\Program Files\OpenVPN\config\";
  44. openVpnProcess.Start();
  45. logInStatusBar1.Text = new System.Net.WebClient().DownloadString("https://api.ipify.org");
  46. }
  47. }
  48.  
  49. private void logInButtonWithProgress1_Click(object sender, EventArgs e)
  50. {
  51. foreach (var p in Process.GetProcessesByName("openvpn"))
  52. {
  53. p.Kill();
  54. logInStatusBar1.Text = "Not Connected";
  55. }
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement