*** wmi 调用问题 *** 急

yangl2000 2003-01-14 12:51:36
在C#里的wmi调用没有问题,但是用VC6写出来怎么只能访问本机的资源,连上别的计算机就不行,在ConnectServer 远程计算机能过去,但是一调用CreateInstanceEnum
就出错,请高手教小弟。

分不够再加
...全文
95 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
52cgi 2003-01-22
  • 打赏
  • 举报
回复
To: yangl2000(a)

我的 QQ: 775341

能来聊聊吗?
yangl2000 2003-01-21
  • 打赏
  • 举报
回复
在C#里我完成了,但是那是通过系统自己调用的,但是一到自己调用这个com连到远程,这是怎么回事呢?谁有这方面的经验呀。
52cgi 2003-01-20
  • 打赏
  • 举报
回复
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer("myserver", "root\microsoftdns", "name", "pass")
...


运行到第二句就出错: "SWbemLocator: 无法为本地连结使用用户凭证"

这是怎么回事?
52cgi 2003-01-20
  • 打赏
  • 举报
回复
我在 VBS 中调用总是说

"SWbemLocator: 无法为本地连结使用用户凭证"


这是怎么回事?
yangl2000 2003-01-19
  • 打赏
  • 举报
回复
你的意思是不是加domain,好像不行呀。
蒋晟 2003-01-16
  • 打赏
  • 举报
回复
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.
蒋晟 2003-01-16
  • 打赏
  • 举报
回复
见鬼,我的程序也不行
蒋晟 2003-01-16
  • 打赏
  • 举报
回复
有足够的权限吗?
birth_chen 2003-01-16
  • 打赏
  • 举报
回复
up

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧