HostAlias Property  
 

Returns the aliases defined for the current hostname.

Syntax

object.HostAlias(Index)

Remarks

The HostAlias property array returns the aliases assigned to the host specified by the HostAddress or HostName properties. If the host address or name can be resolved, the first element in the HostAlias array (an index value of 0) always refers to the host's fully qualified domain name. The end of the alias list is indicated when the property returns an empty string.

When using Visual Studio .NET, you must use the accessor method get_HostAlias instead of the property name, otherwise an error will be returned indicating that it not a member of the control class.

Data Type

String

Example

The following example places the all of the aliases for a specific host into a listbox:

Dim nIndex As Integer

List1.Clear
Socket1.HostName = Trim(Text1.Text)

Do While Len(Socket1.HostAlias(nIndex)) > 0
    List1.AddItem Socket1.HostAlias(nIndex)
    nIndex = nIndex + 1
Loop

See Also

HostAddress Property, HostName Property