private void PicClose_MouseClick(object sender, MouseEventArgs e) { //DialogResult dr = MessageBox.Show("Are you sure to exit system?", "Warning!", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); DialogResult dr = ZKMessgeBox.Show("Exit the program?", "Warning!", ZKMessgeBox.I8Buttons.OKCancel); if (dr == DialogResult.OK) { SDK.sta_DisConnect(); Application.Exit(); } }
public bool TestConnection() { try { if (SDK.GetConnectState()) { return(true); } else { return(false); } } catch { return(false); } finally { SDK.sta_DisConnect(); } }