Contents Index Topic Contents | ||
Previous Topic: ListChannels Method Next Topic: Login Method |
ListUsers Method
Lists users on the server.
Syntax
object.ListUsers UserQueryItems
Parameters
object Required. An object expression that evaluates to an MsChatPr control. UserQueryItems Required. An object expression that evaluates to a ChatItems object. Restricts the user listing to a subset of users. The following table lists the item names that can be used to construct the ChatItems object.
IRC/IRCX IRCX protocols protocol only Channels IPAddress Mask IPAddressOp MaskOp Nickname NicknameOp Remarks
The caller can set criteria on the user's nickname, IP address, or channel. Also, when using the Mask and optionally the MaskOp item names, the user can list the users for which the nickname, IP address, server name, real name, or channel name matches the mask given.
When using the Mask and optionally the MaskOp item names, the call maps to a WHO command; otherwise, it maps to a WHOIS command.
A successful ListUsers call results in a suite of events. First, an OnBeginEnumeration event is fired to mark the beginning of the user listing. Next, one OnUserProperty event occurs for each user listed, where UserItems exposes all the known user properties. Finally, an OnEndEnumeration event is fired to mark the end of the user listing.
Examples
1. List all users on the server:
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" MsChatPr1.ListUsers chatitemobj Set chatitemobj = Nothing(On an IRC server this call maps to a WHO command. On an IRCX server it maps to a WHOIS command.)
2. On an IRCX server, list all users with an IP address that finishes with ".edu":
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("IPAddressOp") = "EndsWith" chatitemobj.Item("IPAddress") = ".edu" MsChatPr1.ListUsers chatitemobj Set chatitemobj = Nothing3. On an IRCX server, list all users with an IP address that contains "microsoft":
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("IPAddressOp") = "Contains" chatitemobj.Item("IPAddress") = "microsoft" MsChatPr1.ListUsers chatitemobj Set chatitemobj = Nothing4. On an IRCX server, list all users with a nickname that contains "joe":
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("NicknameOp") = "Contains" chatitemobj.Item("Nickname") = "joe" MsChatPr1.ListUsers chatitemobj Set chatitemobj = Nothing5. On an IRCX server, list all users in the channel "#newbies":
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("Channels") = "#newbies" MsChatPr1.ListUsers chatitemobj Set chatitemobj = Nothing6. On an IRCX server, list all users for which the nickname, IP address, server name, or real name contains "nath":
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("MaskOp") = "Contains" chatitemobj.Item("Mask") = "nath" MsChatPr1.ListUsers chatitemobj Set chatitemobj = Nothing7. On an IRCX server, list all users for which the nickname, IP address, server name, or real name starts with "Re":
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("MaskOp") = "StartsWith" chatitemobj.Item("Mask") = "Re" MsChatPr1.ListUsers chatitemobj Set chatitemobj = Nothing
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.