コード例 #1
0
 private void StartButton_Click(object sender, RoutedEventArgs e)
 {
     // CoolButton Clicked! Let's show our InputBox.
     //InputBox.Visibility = System.Windows.Visibility.Visible;
     port            = PortText.Text;
     Start.IsEnabled = false;
     Start.Content   = "正在监听";
     init_socks5();
     ShortCut.antiRElement["QQPath"]   = QQPath.Text;
     ShortCut.antiRElement["PortText"] = PortText.Text;
     if (!ShortCut.CheckXml())
     {
         ShortCut.CreateXml(ShortCut.antiRElement);
     }
     else
     {
         ShortCut.ModifyXml(ShortCut.antiRElement);
     }
     if (-1 != QQPath.Text.IndexOf("QQ.exe"))
     {
         try
         {
             Process process = new Process();
             process.StartInfo.FileName = QQPath.Text;
             //process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
             process.StartInfo.CreateNoWindow = true;
             process.Start();
             MinimizeWindow();
         }
         catch (Exception)
         {
             System.Windows.MessageBox.Show("启动QQ.exe失败,请确认路径正确或手动启动");
         }
     }
 }
コード例 #2
0
 public MainWindow()
 {
     InitializeComponent();
     ShortCut.init_shortcut("AntiRecall");
     ShortCut.init_xml();
     CheckUpdate.init_checkUpdate();
     init_minimize();
     if (ShortCut.CheckXml())
     {
         QQPath.Text   = ShortCut.QueryXml("QQPath");
         PortText.Text = ShortCut.QueryXml("PortText");
     }
     else
     {
         ShortCut.CreateXml(ShortCut.antiRElement);
     }
 }