zoukankan      html  css  js  c++  java
  • [WinForm]

    背景

    关闭 WinForm 应用出现 "has stopped working" 错误。

    Windows 日志

    Faulting application name: PcClient.exe, version: 1.0.0.0, time stamp: 0x5a076b99
    Faulting module name: KERNELBASE.dll, version: 10.0.15063.674, time stamp: 0x6d16dd24
    Exception code: 0xe0434352
    Fault offset: 0x000eb872
    Faulting process id: 0xef4
    Faulting application start time: 0x01d35b341fea1746
    Faulting application path: C:Program Files (x86)TestPcClient.exe
    Faulting module path: C:WindowsSystem32KERNELBASE.dll
    Report Id: 4fe7aef6-abc3-424b-9e16-85a18bfdeb2e
    Faulting package full name:
    Faulting package-relative application ID:

     

    错误写法

    private void App_FormClosed(object sender, FormClosedEventArgs e)
    {
        Environment.Exit(0);
    }
    

    正确写法

    private void App_FormClosed(object sender, FormClosedEventArgs e)
    {
        if (Application.MessageLoop)
        {
            Application.Exit();
        }
        else
        {
            Environment.Exit(1);
        }
    }
    

    参考资料

    https://stackoverflow.com/a/12978034

    文章来源

    http://www.cnblogs.com/jinzesudawei/p/7820926.html

  • 相关阅读:
    概率算法_二项分布和泊松分布
    数据库_存储过程简介(oracle版)
    机器学习算法_knn(福利)
    统计算法_概率基础
    统计算法_数值/线性关系度量
    Python总结
    Python 冒泡排序法分析
    Oracle练习详解
    LINUX基础了解
    LINUX下OA搭建
  • 原文地址:https://www.cnblogs.com/jinzesudawei/p/7820926.html
Copyright © 2011-2022 走看看