Determines whether the given user name refers to an existing user.

Syntax

Visual Basic (declaration)
Public Function UserExists( _ 
ByVal AuthenticationTicket as String, _ ByVal UserName as String) as XmlNode

C# (declaration)
public XmlNode UserExists( 
string AuthenticationTicket, string UserName)

Parameters

AuthenticationTicket
    string inforouter ticket
UserName
    string The user name to be tested

Return Value

returns xml fragment.
<response success="true" error="">
if success = "true", the specified user exists.
if success = "false", the error attribute returns the error description

minus gif Example

Visual Basic Example
Public Sub UserExists()
        Const IRAuthenticationTicket As String = "sid-xxxxxxxxxxxxxxx"
        Const IR_UserToBeTested As String = "JoeD"

        Dim IR_Obj As InfoRouter.srv
        Dim xmlResponse As System.Xml.XmlElement
        Try

            IR_Obj = New InfoRouter.srv
            xmlResponse = IR_Obj.UserExists(IRAuthenticationTicket, IR_UserToBeTested)
            If xmlResponse.GetAttribute("success") = "true" Then
                Console.WriteLine("The user '" & IR_UserToBeTested & "' exists")
            Else
                Console.WriteLine("'" & IR_UserToBeTested & "'")
                Console.WriteLine("server response:" & xmlResponse.GetAttribute("error"))
            End If
            xmlResponse = Nothing

        Catch ex As Exception
            Console.WriteLine("error:" & ex.Message)
        Finally
            IR_Obj = Nothing
        End Try
end sub

See Also