Stop() public method

public Stop ( ) : void
return void
Esempio n. 1
0
 protected override void OnClosed(EventArgs e)
 {
     ni.Visible = false;
     proxy.Stop();
     base.OnClosed(e);
     App.Current.Shutdown();
 }
Esempio n. 2
0
 private void menuItem1_Click(object Sender, EventArgs e)
 {
     ni.Visible = false;
     if (proxy != null)
     {
         proxy.Stop();
     }
     Close();
 }
Esempio n. 3
0
 static void Main(string[] args)
 {
     AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
     sock5 = new Socks5Server(IPAddress.Any, 7777);
     sock5.PacketSize = 65535;
     sock5.Start();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new MainForm());
     sock5.Stop();
     //output to console instead.
     Environment.Exit(0);
 }
Esempio n. 4
0
 static void Main(string[] args)
 {
     AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
     sock5            = new Socks5Server(IPAddress.Any, 7777, 4096);
     sock5.PacketSize = 65535;
     sock5.Start();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new MainForm());
     sock5.Stop();
     //output to console instead.
     Environment.Exit(0);
 }
Esempio n. 5
0
        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            if (this.Start.IsChecked == false)
            {
                if (Xml.antiRElement["Mode"] == "proxy")
                {
                    proxy.Stop();
                }

                if (Xml.antiRElement["Mode"] == "patch")
                {
                }
            }

            if (this.Start.IsChecked == true)
            {
                port = PortText.Text;

                if (Xml.antiRElement["Mode"] == "proxy")
                {
                    init_socks5();
                    //Startup.init_startup();
                    //Modify xml
                    Xml.antiRElement["PortText"] = PortText.Text;
                    if (!Xml.CheckXml())
                    {
                        Xml.CreateXml(Xml.antiRElement);
                    }
                    else
                    {
                        Xml.ModifyXml(Xml.antiRElement);
                    }
                }
                else if (Xml.antiRElement["Mode"] == "patch")
                {
                    Xml.antiRElement["PortText"] = PortText.Text;
                    if (!Xml.CheckXml())
                    {
                        Xml.CreateXml(Xml.antiRElement);
                    }
                    else
                    {
                        Xml.ModifyXml(Xml.antiRElement);
                    }
                    var th = new Thread(() => patch_memory.StartPatch());
                    th.Start();
                }
                else
                {
                    System.Windows.MessageBox.Show("请选择一个有效的防撤回模式");
                    return;
                }

                if (-1 != Xml.antiRElement["QQPath"].IndexOf("QQ.exe"))
                {
                    try
                    {
                        Process process = new Process();
                        process.StartInfo.FileName = Xml.antiRElement["QQPath"];
                        //process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
                        process.StartInfo.CreateNoWindow = true;
                        process.Start();
                    }
                    catch (Exception)
                    {
                        System.Windows.MessageBox.Show("启动QQ失败,请确认路径正确或手动启动");
                    }
                    MinimizeWindow();
                }
            }
        }
Esempio n. 6
0
        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            if (this.Start.IsChecked == false)
            {
                if (Xml.currentElement["Mode"] == "proxy")
                {
                    proxy.Stop();
                }

                if (Xml.currentElement["Mode"] == "patch")
                {
                }
            }

            if (this.Start.IsChecked == true)
            {
                port = PortText.Text;

                if (Xml.currentElement["Mode"] == "proxy")
                {
                    Init_socks5();
                    //Startup.init_startup();
                    //Modify xml
                    Xml.currentElement["Port"] = PortText.Text;
                    if (!Xml.CheckXml())
                    {
                        Xml.CreateXml(Xml.antiRElement);
                    }
                    else
                    {
                        Xml.ModifyXml(Xml.currentApp, Xml.currentElement);
                    }
                }
                else if (Xml.currentElement["Mode"] == "patch")
                {
                    Xml.currentElement["Port"] = PortText.Text;
                    Xml.ModifyXml(Xml.currentApp, Xml.currentElement);
                    var th = new Thread(() => instances[Xml.currentApp].StartPatch());
                    th.Start();
                }
                else
                {
                    System.Windows.MessageBox.Show(Strings.invalid_method);
                    this.Start.IsChecked = false;
                    return;
                }

                if (-1 != Xml.currentElement["Path"].IndexOf("exe"))
                {
                    try
                    {
                        Process process = new Process();
                        process.StartInfo.FileName = Xml.currentElement["Path"];
                        //process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
                        process.StartInfo.CreateNoWindow = true;
                        process.Start();
                        MinimizeWindow();
                    }
                    catch (Exception)
                    {
                        System.Windows.MessageBox.Show(Strings.incorrect_target_path);
                        this.Start.IsChecked = false;
                    }
                }
                else
                {
                    System.Windows.MessageBox.Show(Strings.invalid_target_path);
                    this.Start.IsChecked = false;
                }
            }
        }