添加启动提示自动关闭、重启客户端弹出提示功能

Chu Jun 1 year ago
parent dde961b14e
commit dcefe03f51

@ -1 +1 @@
dd5f1753fb63c681d3738811b550e3f060083be3 d922341d769c1979a925cb28d3c62fa571cad17d

@ -100,3 +100,27 @@ D:\烟厂资料\程序测试\远程端\231114-最新\Diaoyong\obj\Debug\Diaoyong
D:\烟厂资料\程序测试\远程端\231114-最新\Diaoyong\obj\Debug\Diaoyong.csproj.CopyComplete D:\烟厂资料\程序测试\远程端\231114-最新\Diaoyong\obj\Debug\Diaoyong.csproj.CopyComplete
D:\烟厂资料\程序测试\远程端\231114-最新\Diaoyong\obj\Debug\Diaoyong.exe D:\烟厂资料\程序测试\远程端\231114-最新\Diaoyong\obj\Debug\Diaoyong.exe
D:\烟厂资料\程序测试\远程端\231114-最新\Diaoyong\obj\Debug\Diaoyong.pdb D:\烟厂资料\程序测试\远程端\231114-最新\Diaoyong\obj\Debug\Diaoyong.pdb
D:\烟厂资料\程序测试\远程端\231115-last\Publish\Diaoyong.exe.config
D:\烟厂资料\程序测试\远程端\231115-last\Publish\Diaoyong.exe
D:\烟厂资料\程序测试\远程端\231115-last\Publish\Diaoyong.pdb
D:\烟厂资料\程序测试\远程端\231115-last\Diaoyong\obj\Debug\Diaoyong.csproj.AssemblyReference.cache
D:\烟厂资料\程序测试\远程端\231115-last\Diaoyong\obj\Debug\Diaoyong.ConnectionTest.resources
D:\烟厂资料\程序测试\远程端\231115-last\Diaoyong\obj\Debug\Diaoyong.Form1.resources
D:\烟厂资料\程序测试\远程端\231115-last\Diaoyong\obj\Debug\Diaoyong.Properties.Resources.resources
D:\烟厂资料\程序测试\远程端\231115-last\Diaoyong\obj\Debug\Diaoyong.csproj.GenerateResource.cache
D:\烟厂资料\程序测试\远程端\231115-last\Diaoyong\obj\Debug\Diaoyong.csproj.CoreCompileInputs.cache
D:\烟厂资料\程序测试\远程端\231115-last\Diaoyong\obj\Debug\Diaoyong.csproj.CopyComplete
D:\烟厂资料\程序测试\远程端\231115-last\Diaoyong\obj\Debug\Diaoyong.exe
D:\烟厂资料\程序测试\远程端\231115-last\Diaoyong\obj\Debug\Diaoyong.pdb
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\Diaoyong.exe.config
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\Diaoyong.exe
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\Diaoyong.pdb
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Diaoyong\obj\Debug\Diaoyong.csproj.AssemblyReference.cache
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Diaoyong\obj\Debug\Diaoyong.ConnectionTest.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Diaoyong\obj\Debug\Diaoyong.Form1.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Diaoyong\obj\Debug\Diaoyong.Properties.Resources.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Diaoyong\obj\Debug\Diaoyong.csproj.GenerateResource.cache
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Diaoyong\obj\Debug\Diaoyong.csproj.CoreCompileInputs.cache
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Diaoyong\obj\Debug\Diaoyong.csproj.CopyComplete
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Diaoyong\obj\Debug\Diaoyong.exe
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Diaoyong\obj\Debug\Diaoyong.pdb

Binary file not shown.

Binary file not shown.

@ -12,6 +12,7 @@ using System.Net.Sockets;
using System.Threading; using System.Threading;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Net.NetworkInformation;
namespace WindowsFormsApp2 namespace WindowsFormsApp2
{ {
@ -20,13 +21,20 @@ namespace WindowsFormsApp2
[DllImport("USER32.DLL")] [DllImport("USER32.DLL")]
public static extern bool SetForegroundWindow(IntPtr hWnd); public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
static extern bool EndDialog(IntPtr hDlg, out IntPtr nResult);
const int NumberOfSupportedCameras = 8; const int NumberOfSupportedCameras = 8;
public Thread recvThread = null; public Thread recvThread = null;
public Thread filerecvThread = null; public Thread filerecvThread = null;
bool m_Done = false; bool m_Done = false;
public static byte[] clientIP = new byte[] { 192, 168, 10, 127 }; public static byte[] clientIP = new byte[] { 192, 168, 1, 178 };
public static byte[] localIP = new byte[] { 192, 168, 10, 127 }; public static byte[] localIP = new byte[] { 192, 168, 10, 127 };
public static int ordPort = 3333; public static int ordPort = 3000;
public static int feedPort = 2999; public static int feedPort = 2999;
public static int filePort = 2999; public static int filePort = 2999;
UdpClient u = null; UdpClient u = null;
@ -35,6 +43,52 @@ namespace WindowsFormsApp2
DialogSetup setup = new DialogSetup(); DialogSetup setup = new DialogSetup();
public static bool Stop = true;//停止 public static bool Stop = true;//停止
public static bool Debug;//调试状态 public static bool Debug;//调试状态
public void ShowMessageBoxTimeout(string text, string caption,
MessageBoxButtons buttons, int timeout)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(CloseMessageBox),
new CloseState(caption, timeout));
MessageBox.Show(text, caption, buttons);
}
private class CloseState
{
private int _Timeout;
public int Timeout
{
get
{
return _Timeout;
}
}
private string _Caption;
public string Caption
{
get
{
return _Caption;
}
}
public CloseState(string caption, int timeout)
{
_Timeout = timeout;
_Caption = caption;
}
}
private void CloseMessageBox(object state)
{
CloseState closeState = state as CloseState;
Thread.Sleep(closeState.Timeout);
IntPtr dlg = FindWindow(null, closeState.Caption);
if (dlg != IntPtr.Zero)
{
IntPtr result;
EndDialog(dlg, out result);
}
}
protected virtual void OnClosing(System.ComponentModel.CancelEventArgs e) protected virtual void OnClosing(System.ComponentModel.CancelEventArgs e)
{ {
m_Done = true; m_Done = true;
@ -373,8 +427,7 @@ namespace WindowsFormsApp2
label6.Text = " 运行中 "; label6.Text = " 运行中 ";
label8.BackColor = Color.Lime; label8.BackColor = Color.Lime;
label6.BackColor = Color.Lime; label6.BackColor = Color.Lime;
ShowMessageBoxTimeout("客户端启动成功", "请耐心等待……", MessageBoxButtons.OK, 2000);
DialogResult dr = MessageBox.Show("启动成功", "状态", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
} }
else else
@ -689,6 +742,8 @@ namespace WindowsFormsApp2
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
this.toolStripStatusLabel1.Text = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); this.toolStripStatusLabel1.Text = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
} }
} }
} }

@ -74,7 +74,6 @@
this.singleCam5.Name = "singleCam5"; this.singleCam5.Name = "singleCam5";
this.singleCam5.Size = new System.Drawing.Size(600, 200); this.singleCam5.Size = new System.Drawing.Size(600, 200);
this.singleCam5.TabIndex = 5; this.singleCam5.TabIndex = 5;
// this.singleCam5.DoubleClick += new System.EventHandler(this.singleCam5_DoubleClick);
// //
// singleCam3 // singleCam3
// //
@ -111,7 +110,6 @@
this.singleCam1.Name = "singleCam1"; this.singleCam1.Name = "singleCam1";
this.singleCam1.Size = new System.Drawing.Size(600, 200); this.singleCam1.Size = new System.Drawing.Size(600, 200);
this.singleCam1.TabIndex = 1; this.singleCam1.TabIndex = 1;
// this.singleCam1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.singleCam1_MouseDoubleClick);
// //
// userControl11 // userControl11
// //
@ -121,7 +119,6 @@
this.userControl11.Name = "userControl11"; this.userControl11.Name = "userControl11";
this.userControl11.Size = new System.Drawing.Size(1330, 900); this.userControl11.Size = new System.Drawing.Size(1330, 900);
this.userControl11.TabIndex = 0; this.userControl11.TabIndex = 0;
// this.userControl11.Load += new System.EventHandler(this.userControl11_Load);
// //
// displayResult // displayResult
// //
@ -129,10 +126,10 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.BackColor = System.Drawing.Color.Black; this.BackColor = System.Drawing.Color.Black;
this.Controls.Add(this.singleCam6);
this.Controls.Add(this.singleCam5); this.Controls.Add(this.singleCam5);
this.Controls.Add(this.singleCam8); this.Controls.Add(this.singleCam8);
this.Controls.Add(this.singleCam7); this.Controls.Add(this.singleCam7);
this.Controls.Add(this.singleCam6);
this.Controls.Add(this.singleCam4); this.Controls.Add(this.singleCam4);
this.Controls.Add(this.singleCam3); this.Controls.Add(this.singleCam3);
this.Controls.Add(this.singleCam2); this.Controls.Add(this.singleCam2);
@ -143,7 +140,6 @@
this.MinimumSize = new System.Drawing.Size(1330, 900); this.MinimumSize = new System.Drawing.Size(1330, 900);
this.Name = "displayResult"; this.Name = "displayResult";
this.Size = new System.Drawing.Size(1330, 900); this.Size = new System.Drawing.Size(1330, 900);
// this.Load += new System.EventHandler(this.displayResult_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
} }

@ -1 +1 @@
9c9b8393333a0be8cfbbdbde65fba7671b7418a8 8f75b02a48889b865fd405241d835e863f2333cd

@ -195,3 +195,55 @@ D:\烟厂资料\程序测试\远程端\231114-最新\Publish\dll\x86\OpenCvSharp
D:\烟厂资料\程序测试\远程端\231114-最新\Publish\dll\x86\opencv_videoio_ffmpeg480.dll D:\烟厂资料\程序测试\远程端\231114-最新\Publish\dll\x86\opencv_videoio_ffmpeg480.dll
D:\烟厂资料\程序测试\远程端\231114-最新\Publish\dll\x64\OpenCvSharpExtern.dll D:\烟厂资料\程序测试\远程端\231114-最新\Publish\dll\x64\OpenCvSharpExtern.dll
D:\烟厂资料\程序测试\远程端\231114-最新\Publish\dll\x64\opencv_videoio_ffmpeg480_64.dll D:\烟厂资料\程序测试\远程端\231114-最新\Publish\dll\x64\opencv_videoio_ffmpeg480_64.dll
D:\烟厂资料\程序测试\远程端\231115-last\Publish\WindowsFormsApp2.dll.config
D:\烟厂资料\程序测试\远程端\231115-last\Publish\WindowsFormsApp2.dll
D:\烟厂资料\程序测试\远程端\231115-last\Publish\WindowsFormsApp2.pdb
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.AssemblyReference.cache
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Alarm_Record.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Camera_glue.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Change_shift.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.displayResult.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Form1.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.DialogSetup.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.FullScreen.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Output_statistic.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Properties.Resources.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.singleCam.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.singleCam2.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.UserControl1.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.DialogLogin.resources
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.GenerateResource.cache
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.CoreCompileInputs.cache
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.CopyComplete
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.dll
D:\烟厂资料\程序测试\远程端\231115-last\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.pdb
D:\烟厂资料\程序测试\远程端\231115-last\Publish\dll\x86\OpenCvSharpExtern.dll
D:\烟厂资料\程序测试\远程端\231115-last\Publish\dll\x86\opencv_videoio_ffmpeg480.dll
D:\烟厂资料\程序测试\远程端\231115-last\Publish\dll\x64\OpenCvSharpExtern.dll
D:\烟厂资料\程序测试\远程端\231115-last\Publish\dll\x64\opencv_videoio_ffmpeg480_64.dll
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\dll\x86\OpenCvSharpExtern.dll
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\dll\x86\opencv_videoio_ffmpeg480.dll
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\dll\x64\OpenCvSharpExtern.dll
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\dll\x64\opencv_videoio_ffmpeg480_64.dll
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\WindowsFormsApp2.dll.config
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\WindowsFormsApp2.dll
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\Publish\WindowsFormsApp2.pdb
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.AssemblyReference.cache
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Alarm_Record.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Camera_glue.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Change_shift.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.displayResult.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Form1.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.DialogSetup.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.FullScreen.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Output_statistic.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Properties.Resources.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.singleCam.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.singleCam2.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.UserControl1.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.DialogLogin.resources
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.GenerateResource.cache
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.CoreCompileInputs.cache
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.CopyComplete
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.dll
D:\烟厂资料\程序测试\远程端\231115-添加启动提示窗口关闭、重启客户端弹出提示功能\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.pdb

Loading…
Cancel
Save