如何使用进程监视器来解析UnauthorizedAccessException [英] How to use Process Monitor to Resolve an UnauthorizedAccessException

查看:127
本文介绍了如何使用进程监视器来解析UnauthorizedAccessException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写从IIS7下的ASP.NET应用程序的日志文件,但不断收到以下异常:

I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception:

UnauthorizedAccessException "Access to the path 'C:\Users\Brady\Exports' is denied."

我一直建议使用进程监视器来帮助解决这一点,但它是一个相当复杂的工具,我真的没有时间花在探索它。请有人可以帮助我,并建议如何使用PM来确定哪些用户试图访问该文件夹等。

I've been advised to use Process Monitor to help resolve this, but it's quite a complex tool, and I really don't have time to spend exploring it. Please can someone assist me and advise how to use PM to determine which user is trying to access the folder etc.

推荐答案

在PM启动时,它会显示一个过滤器对话框。只需点击重置使用标准的过滤。这将产生大量的信息,而你只在极少数人的兴趣。在进程名称的,选择要监视的过程中一行。 Richtclick它并选择的包括的。这限制了报告的事件,以您的应用程序的人。在工具栏中,最右侧的三个图标,让你筛选来源:注册表访问,文件系统访问和进程/线程活动。取消选择注册表和进程/线程,因为你只想要监控的文件访问。
在菜单中选择的选项 - 选择列的。在流程管理的,检查的用户名的。

When PM starts it displays a filter dialog. Just click 'Reset' to use the standard filtering. This will generate lots of messages, and you are only interested in very few of them. Under Process Name, select a line with the process you want to monitor. Richtclick it and choose include . That limits the reported events to the ones of your app. In the toolbar, the three rightmost icons let you filter the sources: Registry access, file system access and process/thread events. Unselect registry and process/threads, since you only want to monitor file access. In the menu choose Options - Select columns. Under Process Management, check User Name.

现在尝试重现错误。如果你仍然得到太多的事件,您可以限制的路径(在路径的栏单击鼠标右键,选择的排除的)。您可以微调通过按Ctrl-L的过滤,界面应该是不言而喻的。 (呵呵,只记得前点击的确定的,当你想创建一个新的过滤规则......我几乎总是落在该特定陷阱点击的添加的; - )

Now try to reproduce the error. If you are still getting too many events, you can limit the path (rightclick in the Path column and choose exclude ). You can fine tune your filtering by clicking Ctrl-L, the interface should be self explanatory. (Oh, just remember to click Add before clicking OK when you want to create a new filter rule... I almost always fall for that particular trap ;-)

这篇关于如何使用进程监视器来解析UnauthorizedAccessException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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