在C#里的wmi调用没有问题,但是用VC6写出来怎么只能访问本机的资源,连上别的计算机就不行,在ConnectServer 远程计算机能过去,但是一调用CreateInstanceEnum
就出错,请高手教小弟。分不够再加

解决方案 »

  1.   

    An error code of Hex 0x80070005 indicates a COM access-denied error.When connecting to WMI on a remote Windows 95 system from a Windows NT/Windows 2000 system there are two issues to consider.If the local system is supplying credentials (your user name and password) of a domain that it is not a member of, synchronous enumerations and queries may take much longer to process.
    If you provide credentials in the process of connecting to WMI, the logon fails and the following error displays: 
    RPC Server is unavailable.When connecting between different domains, you must include the domain name in the username even if the username is the same in both domains. Absence of the domain name results in an access denied error.
      

  2.   

    你的意思是不是加domain,好像不行呀。
      

  3.   

    我在 VBS 中调用总是说    "SWbemLocator: 无法为本地连结使用用户凭证"
    这是怎么回事?
      

  4.   

    Set objLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objService = objLocator.ConnectServer("myserver", "root\microsoftdns", "name", "pass")
    ...
    运行到第二句就出错: "SWbemLocator: 无法为本地连结使用用户凭证"这是怎么回事?
      

  5.   

    在C#里我完成了,但是那是通过系统自己调用的,但是一到自己调用这个com连到远程,这是怎么回事呢?谁有这方面的经验呀。