2012年2月16日 星期四

用PowerShell列出註冊的OCX所支援的method及property

透過PowerShell把已經註冊的OCX物件,所支援的所有method及property,全部都列出來。
PS > $xhp = New-Object -ComObject ${progID}
PS > $xhp | Get-Member -Force -View All

#[Output大概長這樣] 

   TypeName: System.__ComObject#{a65f6989-dace-4cd6-9448-97d725668491}

Name                      MemberType   Definition
----                      ----------   ----------
pstypenames               CodeProperty System.Collections.ObjectModel.Collection`1[[System.String, mscorlib, Version...
psadapted                 MemberSet    psadapted {Visible, AxBorderStyle, Color, Active, Enabled, Cursor, Host, PPor...
psbase                    MemberSet    psbase {GetLifetimeService, InitializeLifetimeService, CreateObjRef, ToString...
psextended                MemberSet    psextended {}
psobject                  MemberSet    psobject {Members, Properties, Methods, ImmediateBaseObject, BaseObject, Type...
CacheStatus               Method       int CacheStatus (string)
ChangeCursor              Method       void ChangeCursor (int)
ClearCache                Method       int ClearCache (int)
CreateObjRef              Method       System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
Delete                    Method       void Delete (string)
Download                  Method       int Download (string, int)
DownloadAVI               Method       int DownloadAVI (string, string)
Equals                    Method       bool Equals(System.Object obj)
GetAVI                    Method       int GetAVI (string, int, string)
GetEDRL                   Method       Variant GetEDRL (int)
GetEDRL1                  Method       string GetEDRL1 (int, string, string, string, string)
GetHashCode               Method       int GetHashCode()
GetHME                    Method       int GetHME (string, int, string)
GetLifetimeService        Method       System.Object GetLifetimeService()
GetLOGL                   Method       Variant GetLOGL (string, string)
GetLOGS                   Method       Variant GetLOGS ()
GetNDRL                   Method       Variant GetNDRL (int)
GetNDRL1                  Method       string GetNDRL1 (int, string, string, string, string)
GetType                   Method       type GetType()
InitializeLifetimeService Method       System.Object InitializeLifetimeService()
Pause                     Method       void Pause (int)
Play                      Method       void Play (string)
RenameCache               Method       int RenameCache (int)
Resize                    Method       void Resize (int, int)
Resume                    Method       void Resume ()
Sample                    Method       void Sample ()
Seek                      Method       void Seek (int)
Setting                   Method       void Setting ()
Snapshot                  Method       void Snapshot (int, string, string)
Stop                      Method       void Stop ()
ToString                  Method       string ToString()
Active                    Property     bool Active () {get}
AxBorderStyle             Property     TxActiveFormBorderStyle AxBorderStyle () {get} {set}
CameraNameStyle           Property     int CameraNameStyle () {get} {set}
Color                     Property     OLE_COLOR Color () {get} {set}
CPort                     Property     int CPort () {get} {set}
Cursor                    Property     short Cursor () {get} {set}
DateStyle                 Property     int DateStyle () {get} {set}
Day                       Property     int Day () {get} {set}
Enabled                   Property     bool Enabled () {get} {set}
Height                    Property     int Height () {get} {set}
Host                      Property     string Host () {get} {set}
Month                     Property     int Month () {get} {set}
MRList                    Property     int MRList () {get}
Password                  Property     string Password () {get} {set}
PlayNow                   Property     bool PlayNow () {get} {set}
PPort                     Property     int PPort () {get} {set}
RecordType                Property     int RecordType () {get} {set}
RInterval                 Property     int RInterval () {get} {set}
RootDir                   Property     string RootDir () {get} {set}
SamplePath                Property     string SamplePath () {get} {set}
Shorter                   Property     bool Shorter () {get} {set}
SiteName                  Property     string SiteName () {get}
SiteNameStyle             Property     int SiteNameStyle () {get} {set}
Speed                     Property     int Speed () {get} {set}
TimeStyle                 Property     int TimeStyle () {get} {set}
UserName                  Property     string UserName () {get} {set}
Visible                   Property     bool Visible () {get} {set}
Width                     Property     int Width () {get} {set}
Year                      Property     int Year () {get} {set}
Reference: stackoverflow

沒有留言:

張貼留言