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
  • 相关阅读:
    (转)动态SQL和PL/SQL的EXECUTE IMMEDIATE选项
    MyBase代码
    LinkedList、ArrayList、Vector
    MyEclipse8.5的Help菜单下没有Software Updates的设置方法
    球星们
    文件内容提取到byte数组里
    List<>Array
    ArcGIS9.3全套下载地址
    administrator用户不见了
    ArcEngine VS2005 C#
  • 原文地址:https://www.cnblogs.com/forward/p/1016831.html
Copyright © 2011-2022 走看看