在webservice程序中用到EventLog写入事件日志的一段代码。但是一直会出现权限的问题。
Event code: 4010
Event message: An unhandled security exception has occurred.
Event time: 2007-6-1 13:22:26
Event time (UTC): 2007-6-1 5:22:26
Event ID: c9da8c48a21848a5b94e6617b418572f
Event sequence: 33
Event occurrence: 6
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/Root/WebSite2-1-128251482456787568
    Trust level: Full
    Application Virtual Path: /WebSite2
    Application Path: c:\inetpub\wwwroot\WebSite2\
    Machine name: ZHANGJIANE-3
 
Process information:
    Process ID: 2408
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
 
Request information:
    Request URL: http://localhost/WebSite2/Default.aspx
    Request path: /WebSite2/Default.aspx
    User host address: 127.0.0.1
    User: 
    Is authenticated: False
    Authentication Type: 
    Thread account name: NT AUTHORITY\NETWORK SERVICE
这是才发现,我的管理员用户却没有操作的权限,而有这个权限的用户是NETWORK SERVICE用户
所以把Administrator的权限该为隶属于中加入NETWORK SERVICE就可以了。
所以在Windows 2003中就算你是管理员也还是有限制的。

posted on 2007-06-01 13:45  何东建  阅读(929)  评论(0编辑  收藏  举报