如何检测用户是否删除了文件? [英] How to detect if user has deleted a file or not?
本文介绍了如何检测用户是否删除了文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我已经在c#.net上制作了试用版windows应用程序。试用信息文件存储在系统文件夹中。现在我想让该文件无法删除,因为如果它被删除,那么用户将永远使用我的应用程序。有没有办法做到这一点?或者如何在应用程序第二次启动时检测用户是否删除了该文件?
Hi, I have made a trial version windows application in c#.net. The trial info file is stored in the system folder. Now i want to make that file undeletable because if it is deleted then the user will use my application forever. So is there any way to do this? or how can i detect if the user has deleted that file when application start second time?
推荐答案
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
if (File.Exist(Path))
{
.... Checking File Data....
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
这篇关于如何检测用户是否删除了文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文