只需一步,快速开始
您需要 登录 才可以下载或查看,没有账号?注册
使用道具 举报
http://bbs.mjtd.com/forum.php?mod=viewthread&tid=72648&replyID=&skin=1
使用WMI查看共享 但是需要正确的用户名和密码(管理员帐户)
(defun test() (setq wmi (vlax-create-object "WbemScripting.SWbemLocator")) (setq meth1 (vlax-invoke-method wmi 'ConnectServer "192.168.0.128" "username" "password" nil nil nil nil nil )) (setq meth2 (vlax-invoke-method meth1 'ExecQuery "Select * from Win32_Share" nil nil nil )) (vlax-for n meth2 (print (vlax-get n "name")) ))
谢谢nonsmall的支持。
是的,你的方法是可以的,而且很好。
但是如果192.168.0.128根本就不存在时,反应同样是很慢,而且出现以下提示:
错误: Automation 错误。 RPC 服务器不可用。
现在的难处是,用vl读取网络文件夹时,如果网络不存在,读取很久才会有回值,也就是
我说有假死机现象。
如果我们用IE试链接不存在的网络,反应也同样是很慢。所以我想是不是没有办法解决这个问题咯?
请大家说明
方法1:
使用DOS命令ping查看是否可以连接
(setq ob_shell (vlax-create-object "WScript.Shell"))(setq ip "192.168.0.128")(setq file "d:\\1.txt")(vlax-invoke-method ob_shell 'run (strcat "cmd /k ping " ip " >" file) 0)
nonsmall发表于2008-12-22 12:40:00方法1:使用DOS命令ping查看是否可以连接(setq ob_shell (vlax-create-object \"WScript.Shell\"))(setq ip \"192.168.0.128\")(setq file \"d:\\1.txt\")(vlax-invoke-method ob_shell 'run (s
高人呀!
太谢谢您了。
就知道没有什么难不倒您的,哈哈
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 ) ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
GMT+8, 2025-7-29 22:15 , Processed in 0.194191 second(s), 26 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.