开发者

Remove autorun.inf from pendrive automatically

I've made a simple application to automatically remove autorun.inf from pendrive.

My algo is very simple, at an interval the app runs how many drive is there if it gets a Removable disk it tries to delete开发者_运维百科 autorun.inf file.

But i want to optimize it by removing the timer. How to do it ?


Your question isn’t to clear. I assume you mean you want your application to run every time a USB drive is inserted? You should be able to do it using a managementeventwatcher.

http://msdn.microsoft.com/en-us/library/system.management.managementeventwatcher.aspx

This component runs a query you provide on your computers WMI instance. WMI will detect your USB drive and then your watcher will raise the event.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜