Windows Media Services SDK banner art
PreviousNext

Connect Method

Makes a connection to a unicast server.

Syntax

NSUnicastMgr.Connect( ServerName )

Parameters

ServerName

A String value specifying the name of the server.

Return Values

Returns a Microsoft® ActiveX® HRESULT error code.

Remarks

To make a connection to the computer on which the script is running, specify LocalHost as ServerName.

Example

The following code in Microsoft® Visual Basic® Script Edition (VBScript) indicates an attempt to establish a connection to a server running on the same computer. If the connection fails, it indicates why the failure happened:

On Error Resume Next
NSUnicastMgr.Connect "LocalHost"
If Err.Number = 0 Then
 MsgBox ("Connected.")
Else   
 MsgBox ("Not connected:" & Err.Description & ".")
End If
PreviousNext


© 1996-1999 Microsoft Corporation. All rights reserved.