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
  • 相关阅读:
    c++笔记
    python笔记
    《c++不在难学--随老鸟快速通关》
    hexo
    hexo搭建
    《趣学算法》,陈小玉
    从机器学习谈起
    成不了AI高手?因为你根本不懂数据!听听这位老教授多年心血练就的最实用统计学
    PyTorch还是TensorFlow?这有一份新手指南
    win10下机器学习TensorFlow搭建
  • 原文地址:https://www.cnblogs.com/forward/p/1016831.html
Copyright © 2011-2022 走看看