zoukankan      html  css  js  c++  java
  • Excel: Access is denied

    调用Excel组件的时候,有时候总会忘记一些东西,这次又是,忘记配置的DCOM中Excel的权限,结果程序总是报错:Access is denied.
    后来才想起来,原来DCOM又忘记配置了~

    然后在网上查,又找到了另一种方法,就是在web.config中设置一个节点,也可以同样达到这个效果,不需要设置DCOM权限,两种方法各有利弊吧

    U need to impersonate the aspnet account when trying to access office applications which requires administrator privileges. By default the asp.net application runs with the privileges of the account : machinename\aspnet

    and, this account does not have administrator privileges by default.

    u can do 3 things to use an administrator account for your asp.net applications:

    1. Add the machinename\aspnet account to the Administrators group by using the computer management console.

    2. Use an account which has administrator privileges on the web server machine: to do this, open ur web.config file, just below the authentication tag write this line:
    <identity impersonate="true" userName="machinename\administrator" password="admin password" />


    this is called impesonating asp.net to use a fixed account.

    3. Open ur web.config file, just below the authentication tag write this line:
    <identity impersonate="true" />

    and, logon with an administrator account on this machine before running the asp.net application. This method is called impersonating asp.net to use the logged on account.

    FYI: http://support.microsoft.com/default.aspx?scid=kb;en-us;257757
  • 相关阅读:
    svmlight、libsvm 和 svmtorch(torch) 极夜.潜的日志 网易博客
    ObjectiveC学习之旅(二)函数、类、作用域
    快速掌握 ObjectiveC (For C/C++ developer)
    MAC系统使用总结
    VM虚拟机安装苹果雪豹操作系统
    asp.net调试遇到的问题
    C#调用WebService
    SqlServer2008建立触发器实例
    sqlserver2008无法登陆问题
    IIS上面部署网站
  • 原文地址:https://www.cnblogs.com/forward/p/1016831.html
Copyright © 2011-2022 走看看