示例#1
0
 private void button2_Click(object sender, EventArgs e)
 {
     isClose = true;
     try
     {
         int isSuccess = CVRSDK.CVR_CloseComm();
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
示例#2
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!isClose)
     {
         try
         {
             CVRSDK.CVR_CloseComm();
             this.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString());
         }
     }
 }