我如何模拟“锁定"的密码?文件(具有写锁的文件) [英] How can I simulate a "locked" file (one which has a write lock)
本文介绍了我如何模拟“锁定"的密码?文件(具有写锁的文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试调试一个问题,即用户偶尔会锁定他们试图打开的文件.该代码似乎具有正确的异常处理,但是用户仍在报告看到错误消息.如何模拟锁定的文件,以便自己进行调试?
I am trying to debug a problem where users occasionally have locked files which they try to open. The code appears to have correct exception handling but users are still reporting seeing error messages. How can I simulate a locked file so that I can debug this myself?
对于Windows.
推荐答案
取决于,但以防万一,MS字锁
如果您不知道您的应用程序是否锁定了文件并且它不释放锁:
只需修改一下您的应用即可(以创建一个testapp),并且永远不要关闭文件(并保持其运行状态)
depends, but in case, MS word locks
if you are wonderig if your application lock files and it do not relase locks:
just modify a bit your aplication (to create a testapp) and never close the file (and keep it runnig)
这篇关于我如何模拟“锁定"的密码?文件(具有写锁的文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文