Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
IWMSAdminAnonUser.SetUserNamePassword (Visual Basic .NET)
The SetUserNamePassword method specifies a user name and password for the authorization process.
Syntax
IWMSAdminAnonUser .SetUserNamePassword( newUserName , newPassword)
Parameters
newUserName
[in] String containing the user name. This cannot be longer than 63 characters.
newPassword
[in] String containing the password.
Return Values
This method does not return a value.
If this method fails, it throws an exception.
| Number | Description |
| 0x80070057 | The length of the user name exceeds 63 characters. |
| 0x8007000E | The server cannot allocate memory for a new user name. |
Example Code
Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices
Private Sub SetNamePassword()
' Declare variables.
Dim Server As WMSServer
Dim Plugin As IWMSPlugin
Dim AdminAnonUser As IWMSAdminAnonUser
Try
' Create the WMSServer object.
Server = New WMSServer()
' Retrieve the plug-in to be configured.
Plugin = Server.Authenticators.Item( _
"WMS Anonymous User Authentication")
' Retrieve the custom interface of the plug-in.
AdminAnonUser = Plugin.CustomInterface
' Set a new user name and password to be associated
' with anonymous server connections.
AdminAnonUser.SetUserNamePassword("NewUserName", "NewPassword")
Catch excCom As COMException
' TODO: Handle COM exceptions.
Catch exc As Exception
' TODO: Handle errors.
Finally
' TODO: Clean-up code goes here.
End Try
End Sub
Requirements
Reference: Add a reference to Microsoft.WindowsMediaServices.
Namespace: Microsoft.WindowsMediaServices.Interop.
Assembly: Microsoft.WindowsMediaServices.dll.
Library: WMSServerTypeLib.dll.
Platform: Windows Server 2003 family, Windows Server 2008 family.
See Also
| Previous | Next |