|
@@ -29,7 +29,11 @@ namespace WinBox
|
|
|
/// </summary>
|
|
|
private void Form1_Load(object sender, EventArgs e)
|
|
|
{
|
|
|
- closeForm = new CloseForm();
|
|
|
+ if (this.closeForm == null)
|
|
|
+ {
|
|
|
+ closeForm = new CloseForm();
|
|
|
+ }
|
|
|
+
|
|
|
//设置IE版本
|
|
|
SetIE(IeVersion.标准ie11);
|
|
|
this.webBrowser1 = new System.Windows.Forms.WebBrowser();
|
|
@@ -50,53 +54,6 @@ namespace WinBox
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void detectionPort()
|
|
|
- {
|
|
|
- string tcpPort = "9191";
|
|
|
- try
|
|
|
- {
|
|
|
- if (tcpPort == "" || tcpPort == null)
|
|
|
- {
|
|
|
- MessageBox.Show("请输入TCP端口号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Process process = new Process();
|
|
|
- process.StartInfo = new ProcessStartInfo("netstat", "/ano");
|
|
|
- process.StartInfo.CreateNoWindow = true;
|
|
|
- process.StartInfo.UseShellExecute = false;
|
|
|
- process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
|
|
- process.StartInfo.RedirectStandardOutput = true;
|
|
|
- process.Start();
|
|
|
- StreamReader reader = process.StandardOutput;
|
|
|
-
|
|
|
- while (!reader.EndOfStream)
|
|
|
- {
|
|
|
- string msg = reader.ReadLine().ToUpper();
|
|
|
- MessageBox.Show(msg);
|
|
|
- if (msg.IndexOf("TCP") > 0 && msg.IndexOf(":" + tcpPort) > 0)
|
|
|
- {
|
|
|
- string info = msg.Trim();
|
|
|
- //MessageBox.Show("TCP:" + tcpPort + "端口被占用!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
|
- break;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MessageBox.Show("有依赖项启动失败,请重新启动客户端或联系管理员!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- reader.Close();
|
|
|
- process.Close();
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- MessageBox.Show("检测TCP端口:" + tcpPort + "失败!" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private void Form1_Activated(object sender, System.EventArgs e)
|
|
|
{
|
|
|
// Label1.Text = "x: " + x + " y: " + y;
|