检测有人访问文本文件并将数据返回给阅读器 [英] Detect when someone access text file and return data to the reader

查看:72
本文介绍了检测有人访问文本文件并将数据返回给阅读器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个power builder应用程序,遗憾的是我没有源代码。此应用程序从.ini文件中读取服务器详细信息现在的问题是如何保护用户的该文件中的数据。因为我没有源代码所以我无法在Power Builder应用程序中构建一些逻辑。我想知道是否有任何方法(在.Net中)我可以检测到该文件已被访问并从某些.Net解决方案将数据返回到电源构建器应用程序?

I have a power builder application, unfortunately i don't have source code. This application reads server detail from .ini file. Now the question is how to secure the data inside that file from user. As i don't have the source code so i can't build some logic inside Power builder application. I am wondering is there any way(in .Net) i can detect that file has been accessed and return data to power builder application from some .Net solution?

推荐答案

假设access意味着修改,是的,只需检查fileinfo,lastwritetime。 Psudo代码:FileInfo fi = new FileInfo(myfilename);



只需检查一下它的变化做什么......是的你也可以使用filewatcher ..我更喜欢我的方法在计时器或循环中。
Assuming "accessed" means modified, yes, just check the fileinfo, lastwritetime. Psudo code: FileInfo fi=new FileInfo(myfilename);

Just check that and when it changes do something... and yes you can use the filewatcher too.. I prefer my method on a timer or in a loop.


并非没有极度痛苦。没有简单的方法可以做到这一点。



没有任何事件可以告诉你正在访问文件。



我甚至不确定你是否可以在没有管理员权限的情况下在机器上执行此操作,因为如果没有某种文件系统过滤器驱动程序我没有看到任何方法这样做我甚至不确定会工作。
Not without extreme pain. There is no easy way to do this.

There are no events anywhere that will tell you that a file is being accessed.

I'm not even sure you can do it without admin permissions on the machine as I don't see any way to do this without some kind of file system filter driver and I'm not even sure that will work.


这篇关于检测有人访问文本文件并将数据返回给阅读器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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