当前位置:网站首页>C#控制台退出前操作
C#控制台退出前操作
2022-08-04 11:47:00 【Risehuxyc】
最近我的项目需要在退出前保存数据到数据库,所以研究了一下。
using System;
namespace TestExit2
{
internal class Program
{
static void onProcessExit(object sender,EventArgs e)
{
Console.WriteLine("Exit");
Console.ReadLine();
}
static void Main(string[] args)
{
AppDomain.CurrentDomain.ProcessExit += new EventHandler(onProcessExit);
}
}
}
边栏推荐
猜你喜欢
Leetcode刷题——路径总和
项目管理前景
Leetcode brush questions - 543. Diameter of binary trees, 617. Merging binary trees (recursive solution)
Flutter使用 json_serializable 解析 JSON 最佳方案
论文翻译:2022_Time-Frequency Attention for Monaural Speech Enhancement
200ppi转以太网通过4Gwifi在医药设备移动平台(平板电脑、手机)
剑指长城炮? 长安全新皮卡官方谍照
Redis(一)安装与配置
国际原子能机构总干事警告称扎波罗热核电站安全形势已“完全失控”
Leetcode brush - structure binary tree (105. Once upon a time sequence and the sequence structure binary tree traversal sequence, 106. From the sequence with the sequence structure binary tree travers
随机推荐
Rust 从入门到精通04-变量
你值得拥有的登录注册页面(附赠源码)
The use of DDR3 (Naive) in Xilinx VIVADO (2) Read and write design
复盘:经典的HR面试问题,这些问题可以挖掘你个人的素质,看看你是否合适合我们部门
如何用一条命令将网页转成电脑 App
多行函数;group_by分组;having分组后筛选;单表查询总结
JS逆向字体反爬,某供应商平台反爬实践
终于有人把分布式机器学习讲明白了
123
Transferring Rich Feature Hierarchies for Robust
Leetcode刷题——543. 二叉树的直径、617. 合并二叉树(递归解决)
mysqldump远程备份数据库
从零开始Blazor Server(7)--使用Furion权限验证
ESP8266-Arduino编程实例-APDS-9930环境光和趋近感器驱动
请 AI 画家弄了个 logo,网友热议:画得非常好,下次别画了!
记我的第一篇CCF-A会议论文|在经历六次被拒之后,我的论文终于中啦,耶!
Share | technology integration electronic fence function of scheduling system
监督和半监督学习下的多标签分类综述
Redis (1) installation and configuration
Leetcode brush questions - 543. Diameter of binary trees, 617. Merging binary trees (recursive solution)