zoukankan      html  css  js  c++  java
  • 退出winform时弹出确认按钮

    代码
     /// <summary>
            
    /// 窗体关闭事件的处理程序
            
    /// </summary>
            
    /// <param name="sender"></param>
            
    /// <param name="e"></param>
            private void Form1_FormClosing(object sender, FormClosingEventArgs e)
            {
                
    if (MessageBox.Show("确实要退出服务程序吗?""退出程序", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    
    if ((MainTCPListenerThread != null&& MainTCPListenerThread.IsAlive)
                    {
                        StopTCPServerFun();
                        MainTCPListenerThread.Abort();
                    }
                    Environment.Exit(
    0);
                }
                
    else
                {
                    e.Cancel
    =true;
                }
            }


    ////////////////////////////////
    ////////Sixi. Let it be.../////
    //////////////////////////////

  • 相关阅读:
    xshell 缺少mfc110u.dll
    notepad++ 常用插件
    java 发送 http post 和 get 请求(利用unirest)
    my.conf配置大全
    md5算法
    sprinboot+redis
    jq下拉插件,chosen
    springboot+idea 热部署
    Jquery 监听浏览器前进后退
    手机自带的表情入库
  • 原文地址:https://www.cnblogs.com/sixiweb/p/1717082.html
Copyright © 2011-2022 走看看