From df8736bcb1158a139d4d1fe936764fbf9d0f3577 Mon Sep 17 00:00:00 2001
From: 820689062 <820689062@qq.com>
Date: Thu, 1 Aug 2024 00:22:40 +0800
Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=9C=80=E8=A6=81=E5=AF=86?=
=?UTF-8?q?=E7=A0=81=EF=BC=8C=E9=80=9A=E8=BF=87=E6=8C=89=E9=92=AE=E5=8F=AF?=
=?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=89=93=E5=BC=80=E5=9B=BE=E7=89=87=E6=96=87?=
=?UTF-8?q?=E4=BB=B6=E8=B7=AF=E5=BE=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
HisenceYoloDetection/CheckDiffSciHelper.cs | 8 +-
HisenceYoloDetection/Form2.Designer.cs | 83 +++++++++++++
HisenceYoloDetection/Form2.cs | 39 ++++++
HisenceYoloDetection/Form2.resx | 120 +++++++++++++++++++
HisenceYoloDetection/MainForm.Designer.cs | 66 +++++++++--
HisenceYoloDetection/MainForm.cs | 131 +++++++++++++++++----
6 files changed, 407 insertions(+), 40 deletions(-)
create mode 100644 HisenceYoloDetection/Form2.Designer.cs
create mode 100644 HisenceYoloDetection/Form2.cs
create mode 100644 HisenceYoloDetection/Form2.resx
diff --git a/HisenceYoloDetection/CheckDiffSciHelper.cs b/HisenceYoloDetection/CheckDiffSciHelper.cs
index be8911a..58d5e83 100644
--- a/HisenceYoloDetection/CheckDiffSciHelper.cs
+++ b/HisenceYoloDetection/CheckDiffSciHelper.cs
@@ -72,7 +72,7 @@ namespace HisenceYoloDetection
/// 要对比的图像
/// 白板黑字为true
/// 存储路径
- public static bool CheckDiffSci(string path1, Mat MatDet, ref Mat ResultMat,Rect sqlrect, Rect detrect, bool IfWhiteWord, string saveDir)
+ public static bool CheckDiffSci(string path1, Mat MatDet, ref Mat ResultMat,Rect sqlrect, Rect detrect, bool IfWhiteWord, string saveDir,string SN)
{
// 读取和处理第一张图片。。
Mat img1 = Cv2.ImRead(path1, ImreadModes.Color);
@@ -152,7 +152,7 @@ namespace HisenceYoloDetection
Cv2.Resize(thr1, thr1, new Size(550, 270));
Cv2.Resize(thr2, thr2, new Size(550, 270));
DateTime dt = DateTime.Now;
- string filename = dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString();
+ string filename = SN;
// string savePath4 = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path1) + filename + "_thr1.png");
// 保存结果
@@ -317,7 +317,7 @@ namespace HisenceYoloDetection
/// 要对比的图像
/// 白板黑字为true
/// 存储路径
- public static bool CheckDiffSci(string path1, Mat MatDet, Rect sqlrect, Rect detrect, bool IfWhiteWord, string saveDir)
+ public static bool CheckDiffSci(string path1, Mat MatDet, Rect sqlrect, Rect detrect, bool IfWhiteWord, string saveDir,string SN)
{
// 读取和处理第一张图片
Mat img1 = Cv2.ImRead(path1, ImreadModes.Color);
@@ -394,7 +394,7 @@ namespace HisenceYoloDetection
Cv2.Resize(thr1, thr1, new Size(845, 498));
Cv2.Resize(thr2, thr2, new Size(845, 498));
DateTime dt = DateTime.Now;
- string filename = dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString();
+ string filename = SN;
//string savePath4 = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path1) + filename + "_thr1.png");
// 保存结果
diff --git a/HisenceYoloDetection/Form2.Designer.cs b/HisenceYoloDetection/Form2.Designer.cs
new file mode 100644
index 0000000..a4ed7cb
--- /dev/null
+++ b/HisenceYoloDetection/Form2.Designer.cs
@@ -0,0 +1,83 @@
+namespace HisenceYoloDetection
+{
+ partial class Form2
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ button1 = new Button();
+ textBox1 = new TextBox();
+ label1 = new Label();
+ SuspendLayout();
+ //
+ // button1
+ //
+ button1.Location = new Point(301, 82);
+ button1.Name = "button1";
+ button1.Size = new Size(112, 34);
+ button1.TabIndex = 0;
+ button1.Text = "验证";
+ button1.UseVisualStyleBackColor = true;
+ //
+ // textBox1
+ //
+ textBox1.Location = new Point(224, 34);
+ textBox1.Name = "textBox1";
+ textBox1.Size = new Size(269, 30);
+ textBox1.TabIndex = 1;
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.Location = new Point(91, 34);
+ label1.Name = "label1";
+ label1.Size = new Size(100, 24);
+ label1.TabIndex = 2;
+ label1.Text = "退出密码:";
+ label1.Click += label1_Click;
+ //
+ // Form2
+ //
+ AutoScaleDimensions = new SizeF(11F, 24F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(674, 130);
+ Controls.Add(label1);
+ Controls.Add(textBox1);
+ Controls.Add(button1);
+ Name = "Form2";
+ Text = "退出验证";
+ Load += Form2_Load;
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private Button button1;
+ private TextBox textBox1;
+ private Label label1;
+ }
+}
\ No newline at end of file
diff --git a/HisenceYoloDetection/Form2.cs b/HisenceYoloDetection/Form2.cs
new file mode 100644
index 0000000..a23c0d7
--- /dev/null
+++ b/HisenceYoloDetection/Form2.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HisenceYoloDetection
+{
+ public partial class Form2 : Form
+ {
+ public string EnteredPassword { get; private set; }
+ public Form2()
+ {
+ InitializeComponent();
+ button1.Click += button1_Click; // 订阅按钮点击事件
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ EnteredPassword = textBox1.Text;
+ DialogResult = DialogResult.OK;
+ Close();
+ }
+
+ private void Form2_Load(object sender, EventArgs e)
+ {
+ CenterToScreen();
+ }
+
+ private void label1_Click(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
diff --git a/HisenceYoloDetection/Form2.resx b/HisenceYoloDetection/Form2.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/HisenceYoloDetection/Form2.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/HisenceYoloDetection/MainForm.Designer.cs b/HisenceYoloDetection/MainForm.Designer.cs
index c6f9581..a7fc875 100644
--- a/HisenceYoloDetection/MainForm.Designer.cs
+++ b/HisenceYoloDetection/MainForm.Designer.cs
@@ -151,6 +151,9 @@
StartDecBtn = new Button();
CloseDecBtn = new Button();
groupBox6 = new GroupBox();
+ button6 = new Button();
+ button5 = new Button();
+ button4 = new Button();
textBox2 = new TextBox();
label37 = new Label();
textBox3 = new TextBox();
@@ -1387,10 +1390,10 @@
groupBox8.Controls.Add(label20);
groupBox8.Controls.Add(textBox1);
groupBox8.Controls.Add(label35);
- groupBox8.Location = new Point(11, 326);
+ groupBox8.Location = new Point(11, 368);
groupBox8.Name = "groupBox8";
groupBox8.RightToLeft = RightToLeft.No;
- groupBox8.Size = new Size(596, 462);
+ groupBox8.Size = new Size(596, 420);
groupBox8.TabIndex = 24;
groupBox8.TabStop = false;
groupBox8.Text = "生产信息";
@@ -1508,7 +1511,7 @@
label35.Name = "label35";
label35.Size = new Size(75, 25);
label35.TabIndex = 14;
- label35.Text = "误检率";
+ label35.Text = "误检数";
//
// groupBox7
//
@@ -1557,6 +1560,9 @@
//
// groupBox6
//
+ groupBox6.Controls.Add(button6);
+ groupBox6.Controls.Add(button5);
+ groupBox6.Controls.Add(button4);
groupBox6.Controls.Add(textBox2);
groupBox6.Controls.Add(label37);
groupBox6.Controls.Add(textBox3);
@@ -1565,14 +1571,47 @@
groupBox6.Controls.Add(ScannerBox);
groupBox6.Location = new Point(11, 120);
groupBox6.Name = "groupBox6";
- groupBox6.Size = new Size(582, 191);
+ groupBox6.Size = new Size(582, 231);
groupBox6.TabIndex = 22;
groupBox6.TabStop = false;
groupBox6.Text = "基础信息";
//
+ // button6
+ //
+ button6.Location = new Point(438, 172);
+ button6.Margin = new Padding(4, 2, 4, 2);
+ button6.Name = "button6";
+ button6.Size = new Size(137, 54);
+ button6.TabIndex = 25;
+ button6.Text = "第二块NG";
+ button6.UseVisualStyleBackColor = true;
+ button6.Click += button6_Click;
+ //
+ // button5
+ //
+ button5.Location = new Point(438, 95);
+ button5.Margin = new Padding(4, 2, 4, 2);
+ button5.Name = "button5";
+ button5.Size = new Size(137, 54);
+ button5.TabIndex = 24;
+ button5.Text = "第一块NG";
+ button5.UseVisualStyleBackColor = true;
+ button5.Click += button5_Click;
+ //
+ // button4
+ //
+ button4.Location = new Point(438, 22);
+ button4.Margin = new Padding(4, 2, 4, 2);
+ button4.Name = "button4";
+ button4.Size = new Size(137, 54);
+ button4.TabIndex = 21;
+ button4.Text = "相机照片";
+ button4.UseVisualStyleBackColor = true;
+ button4.Click += button4_Click_2;
+ //
// textBox2
//
- textBox2.Location = new Point(128, 146);
+ textBox2.Location = new Point(128, 169);
textBox2.Margin = new Padding(4, 2, 4, 2);
textBox2.Name = "textBox2";
textBox2.ReadOnly = true;
@@ -1582,7 +1621,7 @@
// label37
//
label37.AutoSize = true;
- label37.Location = new Point(7, 146);
+ label37.Location = new Point(7, 172);
label37.Margin = new Padding(4, 0, 4, 0);
label37.Name = "label37";
label37.Size = new Size(96, 25);
@@ -1592,17 +1631,17 @@
//
// textBox3
//
- textBox3.Location = new Point(128, 95);
+ textBox3.Location = new Point(128, 107);
textBox3.Margin = new Padding(4, 2, 4, 2);
textBox3.Name = "textBox3";
textBox3.ReadOnly = true;
- textBox3.Size = new Size(402, 31);
+ textBox3.Size = new Size(279, 31);
textBox3.TabIndex = 21;
//
// label25
//
label25.AutoSize = true;
- label25.Location = new Point(7, 95);
+ label25.Location = new Point(7, 110);
label25.Margin = new Padding(4, 0, 4, 0);
label25.Name = "label25";
label25.Size = new Size(96, 25);
@@ -1627,7 +1666,7 @@
ScannerBox.Margin = new Padding(4, 2, 4, 2);
ScannerBox.Name = "ScannerBox";
ScannerBox.ReadOnly = true;
- ScannerBox.Size = new Size(402, 31);
+ ScannerBox.Size = new Size(279, 31);
ScannerBox.TabIndex = 18;
//
// linkLabel1
@@ -1641,10 +1680,10 @@
// tabPage3
//
tabPage3.Controls.Add(panel2);
- tabPage3.Location = new Point(4, 33);
+ tabPage3.Location = new Point(4, 34);
tabPage3.Margin = new Padding(4, 2, 4, 2);
tabPage3.Name = "tabPage3";
- tabPage3.Size = new Size(1276, 816);
+ tabPage3.Size = new Size(1276, 815);
tabPage3.TabIndex = 4;
tabPage3.Text = "录入新型号";
tabPage3.UseVisualStyleBackColor = true;
@@ -2200,5 +2239,8 @@
private Label label36;
private Label label37;
private PictureBox pictureBox1;
+ private Button button4;
+ private Button button5;
+ private Button button6;
}
}
diff --git a/HisenceYoloDetection/MainForm.cs b/HisenceYoloDetection/MainForm.cs
index bc56670..4080dae 100644
--- a/HisenceYoloDetection/MainForm.cs
+++ b/HisenceYoloDetection/MainForm.cs
@@ -79,6 +79,7 @@ namespace HisenceYoloDetection
ManualResetEvent _runHandleAfter = new ManualResetEvent(false);
AutoResetEvent _runThreadFormtype = new AutoResetEvent(false);
bool PLC545 = false;
+ private const string CorrectPassword = "12345";
bool PLC548 = false;
string m_sKEYENCEBar;
@@ -1393,11 +1394,11 @@ namespace HisenceYoloDetection
// MoveToP(51043, YPos, ZPos + (int)(dismove));
//Cam1.Snapshot();
MoveToP(5815, YPos, ZPos);
- melsecPLCTCPDriver.WriteInt("550", 0);//
+ //melsecPLCTCPDriver.WriteInt("550", 0);//
- Thread.Sleep(1000);//ϴ»ܹȥ
+ //Thread.Sleep(1000);//ϴ»ܹȥ
//if (xKNow != null)
//{
@@ -1555,10 +1556,10 @@ namespace HisenceYoloDetection
}
- string pathfile = fitImageFolder + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "1.jpg";
+ string pathfile = fitImageFolder + m_sKEYENCEBar + ".jpg";
//CamShow1.ImaMAt = cameraMat;
cameraMat.ImWrite(pathfile);
- CheckDiffSciHelper1.ResizeImage(pathfile,pathfile,640,480,75);
+ CheckDiffSciHelper1.ResizeImage(pathfile, pathfile, 640, 480, 75);
}
///
@@ -1567,7 +1568,7 @@ namespace HisenceYoloDetection
///
///
///
-
+
public volatile int AllDsums = 0;
public volatile int NGDsums = 0;
public volatile int OKDsums = 0;
@@ -1626,14 +1627,14 @@ namespace HisenceYoloDetection
myLog("ģɹ", DateTime.Now);
}
-
-
+
+
}
}
- bool MatchStr=false;
+ bool MatchStr = false;
if (xKNow != null)
{
string IOcrBAr = xKNow.OcrBar;
@@ -1699,7 +1700,7 @@ namespace HisenceYoloDetection
if (mL.ResultMap != null)
{
- mL.ResultMap.Save("D://cam1//" + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "1result.jpg");
+ mL.ResultMap.Save("D://cam1//" + m_sKEYENCEBar + "result.jpg");
ResultMatShow.Image = mL.ResultMap;
}
@@ -1733,7 +1734,7 @@ namespace HisenceYoloDetection
string detstr = string.Join(",", RealCFLabels); //Ϊabc-def-ghi -,Ҳʡ
//ȶԿ
- MatchStr = listLabels.SequenceEqual(RealCFLabels);
+ MatchStr = listLabels.SequenceEqual(RealCFLabels);
if (MatchStr == false)
{
@@ -1778,9 +1779,10 @@ namespace HisenceYoloDetection
//bool MatchStr = ManagerModelHelper.IsMatchSQLText(ref mCut, ref xK_HisenceSQLWord, ref xK_MatchDet);
- melsecPLCTCPDriver.WriteInt("550", 0);//
+
if (MatchStr)
{
+
OKDsums++;
myLog("ƥɹ", DateTime.Now);
//ʾ
@@ -1789,7 +1791,7 @@ namespace HisenceYoloDetection
{
OKOrNGShow.Image = OKbitmap;
}));
-
+ melsecPLCTCPDriver.WriteInt("550", 0);//
}
else
@@ -1810,7 +1812,7 @@ namespace HisenceYoloDetection
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//̵
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//
-
+ melsecPLCTCPDriver.WriteInt("550", 0);//
OKDsums++;
WUsums++;
this.Invoke(new Action(() =>
@@ -1829,7 +1831,7 @@ namespace HisenceYoloDetection
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//̵
-
+ melsecPLCTCPDriver.WriteInt("550", 0);//
this.Invoke(new Action(() =>
{
@@ -2597,7 +2599,7 @@ namespace HisenceYoloDetection
string detstr = "";
- if (keyValueResult.Count<=1)
+ if (keyValueResult.Count <= 1)
{
return;
}
@@ -3344,7 +3346,7 @@ namespace HisenceYoloDetection
string TextWoidStr = OcrFuzzyTextInsert.Join("##"); //ʵʵļ
string SQLStr = "";//־ʾݿĹؼ
bool juanjiMatch = false;
- string filenameone = dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString();
+ string filenameone = m_sKEYENCEBar;
switch (blockIndex)
{
case "1"://ȫƥ Ϣ
@@ -3401,8 +3403,8 @@ namespace HisenceYoloDetection
Rect rectsql = CheckDiffSciHelper.strChangeRect(SQlxK_HisenceWord.TwoRect);
Rect rectDet = CheckDiffSciHelper.strChangeRect(xK_HisenceWord.TwoRect);
bool iswhite = IsMostlyWhite(PathSql);//жݿģ鱳ɫ
-
- Mat SqlImg= Cv2.ImRead(PathSql);
+
+ Mat SqlImg = Cv2.ImRead(PathSql);
Mat SqlBtn = GetCroppedImage(SqlImg, rectsql);
Mat BtnImg = GetCroppedImage(CutBlockMat, rectDet);//ȡʵʱͼťͼƬ
Bitmap bitmap = MatToBitmap(BtnImg);
@@ -3416,7 +3418,7 @@ namespace HisenceYoloDetection
}));
Mat matresult = CutBlockMat.Clone();
- juanjiMatch = CheckDiffSciHelper.CheckDiffSci(PathSql, CutBlockMat,ref matresult, rectsql, rectDet, iswhite, "D://Hisence//Test");
+ juanjiMatch = CheckDiffSciHelper.CheckDiffSci(PathSql, CutBlockMat, ref matresult, rectsql, rectDet, iswhite, "D://Hisence//Test", m_sKEYENCEBar);
// juanjiMatch = true;
if (!OneIF1 || !juanjiMatch)
@@ -3448,7 +3450,7 @@ namespace HisenceYoloDetection
Rect rect = new Rect(0, 0, 0, 0);
string PathSql = SQlxK_HisenceWord.ThreeblockPath;
bool iswhite = IsMostlyWhite(PathSql);
- juanjiMatch = CheckDiffSciHelper1.CheckDiffSci(PathSql, CutBlockMat, rect, rect, iswhite, "D://Hisence//Test1");
+ juanjiMatch = CheckDiffSciHelper1.CheckDiffSci(PathSql, CutBlockMat, rect, rect, iswhite, "D://Hisence//Test1", m_sKEYENCEBar);
if (!OneIF1 || !juanjiMatch)
{
OneIF = true;//6.28
@@ -3807,6 +3809,7 @@ namespace HisenceYoloDetection
///
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
+
melsecPLCTCPDriver.WriteInt("550", 0);
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);
@@ -3839,10 +3842,24 @@ namespace HisenceYoloDetection
private void CloseDecBtn_Click(object sender, EventArgs e)
{
- meachineState = MeachineState.machine_closing;
- melsecPLCTCPDriver.WriteInt("550", 0);
- melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);
- melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);
+ using (var passwordForm = new Form2())
+ {
+ if (passwordForm.ShowDialog() == DialogResult.OK)
+ {
+ if (passwordForm.EnteredPassword == CorrectPassword)
+ {
+ // ȷִز
+ meachineState = MeachineState.machine_closing;
+ melsecPLCTCPDriver.WriteInt("550", 0);
+ melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);
+ melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);
+ }
+ else
+ {
+ MessageBox.Show("", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
}
private void label24_Click(object sender, EventArgs e)
@@ -3884,5 +3901,71 @@ namespace HisenceYoloDetection
{
}
+
+ private void button6_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ string FolderPath = "D:\\Hisence\\Test\\2\\ng";
+ // ȷļ·
+ if (System.IO.Directory.Exists(FolderPath))
+ {
+ // ʹ Process ļԴָļ
+ Process.Start("explorer.exe", FolderPath);
+ }
+ else
+ {
+ MessageBox.Show("ָļв", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show($"ļ: {ex.Message}", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void button4_Click_2(object sender, EventArgs e)
+ {
+ try
+ {
+ string FolderPath = "D:\\Hisence\\cam1";
+ // ȷļ·
+ if (System.IO.Directory.Exists(FolderPath))
+ {
+ // ʹ Process ļԴָļ
+ Process.Start("explorer.exe", FolderPath);
+ }
+ else
+ {
+ MessageBox.Show("ָļв", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show($"ļ: {ex.Message}", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void button5_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ string FolderPath = "D:\\Hisence\\Test\\1\\ng";
+ // ȷļ·
+ if (System.IO.Directory.Exists(FolderPath))
+ {
+ // ʹ Process ļԴָļ
+ Process.Start("explorer.exe", FolderPath);
+ }
+ else
+ {
+ MessageBox.Show("ָļв", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show($"ļ: {ex.Message}", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
}
}