Board logo

标题: [问题求助] VBS的TLI.TLIApplication怎么准确显示属性和方法? [打印本页]

作者: czjt1234    时间: 2013-5-9 12:01     标题: VBS的TLI.TLIApplication怎么准确显示属性和方法?

如果对象能响应事件,这个可以读取所有事件名
  1. Set objTLIApplication = CreateObject("TLI.TLIApplication")
  2. Set objSWbemSink = Wscript.CreateObject("WbemScripting.SWbemSink", "Sink_")
  3. Set objTypeInfo = objTLIApplication.ClassInfoFromObject(objSWbemSink)
  4. s = ""
  5. Set objInterfaceInfo = objTypeInfo.DefaultEventInterface
  6. Set objMembers = objInterfaceInfo.Members    '如果对象没有事件,这行会报错
  7. For Each objMemberInfo In objMembers
  8.     s = s & objMemberInfo.Name & vbCrLf
  9. Next
  10. Msgbox s
复制代码
但是读取属性和方法时,发现有多余的显示和重复显示
请问为什么会有多余和重复
怎么区分哪个是属性哪个是方法?
  1. Set objDictionary = CreateObject("Scripting.Dictionary")
  2. Set objTLIApplication = CreateObject("TLI.TLIApplication")
  3. Set objTypeInfo = objTLIApplication.ClassInfoFromObject(objDictionary)
  4. s = ""
  5. Set objInterfaceInfo = objTypeInfo.DefaultInterface
  6. Set objMembers = objInterfaceInfo.Members
  7. For Each objMemberInfo In objMembers
  8.     s = s & objMemberInfo.Name & vbCrLf
  9. Next
  10. Msgbox s
复制代码





欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2