如何在winform中保存临时文件以自动关闭c# [英] How to save temp file for automatic shutdown in winform c#

查看:185
本文介绍了如何在winform中保存临时文件以自动关闭c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,



我在winform c#& sql server。



我使用datagridview(作为excel)进行数据输入。有固定的结构。并将这些条目存储在sql server 2005中。



对我来说工作正常。



现在问题是,如何在自动关机,断电等时保存像Word这样的临时文件,并且我想存储这些datagridview数据。



我想要最快的保存和备份方式。我试过excel但是对我工作很慢。



请帮我解决这个问题。谢谢你。



抱歉英语不好。

Hi Expert,

I am working in winform c# & sql server.

I am using datagridview (as excel ) for data entry.There is fixed structure. And storing these entries in sql server 2005.

And is working fine for me.

Now problem is , How to save temp-file like Word does when automatic shutdown,poweroff etc ,And i want to store these datagridview data as it is .

I want fastest way to save and backup. I tried in excel but working slow for me.

Please Help me to solve this problem.Thanks in adv.

And sorry for bad english.

推荐答案

你可以通过使用类处理系统事件来实现它.Microsoft.Win32.SystemEvents

http:// msdn .microsoft.com / zh-cn / library / microsoft.win32.systemevents.aspx [ ^ ]。



-SA
You can do it by handling system events using the class Microsoft.Win32.SystemEvents:
http://msdn.microsoft.com/en-us/library/microsoft.win32.systemevents.aspx[^].

—SA


这篇关于如何在winform中保存临时文件以自动关闭c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆