ChangePassword()


Use to change password of current User Account.

Public Function ChangePassword(ByVal SessionID As String, _
                               ByVal OldPassword As String, _
                               ByVal NewPassword As String) _
                               As Boolean

Parameters

SessionID
String - GUID
The current session's GUID in string format. This is a 32-character hexidecimal string in the format:
00000000-0000-0000-0000-000000000000. This is the value returned by the Login() function.
OldPassword 
String(8,32)
Must match current session password. 
NewPassword 
String(8,32)
A "strong" password with a minimum length of 8 and maximum length of 32. 

Returns

Boolean 
True if successful, false on failure.

Remarks

Loren Data requires strong passwords that include at least one uppercase, one lowercase, one number and one special character. For example This1IsGood!

Example

Visual Basic
Imports System.Xml
Imports System.Web.Services.Protocols

Class ErrorInfo
    Public ErrorCode As Short
    Public ErrorString As String
    Public ErrorItem As String
    Public ErrorMessage As String
End Class

Partial Class _Default
    Inherits System.Web.UI.Page
    Private ec As New ecgrid.ECGridOSAPIv2
    Private SyessionID As String
Protected Sub ChangePassword_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) _ Handles ChangePassword.Click
SessionID = StartSession()


If SessionID.length > 0 Then If ec.ChangePassword(Password.text, NewPassword.text) Then Password.text = NewPassword.text Else NewPassword.text = "[Invalid]" End If EndSession(SessionID) End If End Sub Private Function StartSession() As String Dim SessionID As String Dim ErrorInfo As ErrorInfo Try SessionID = ec.Login(LoginName.Text, Password.Text) _SessionID.Text = SessionID Return SessionID Catch ex As SoapException ErrorInfo = ShowException(ex) Return "" End Try End Function Private Function EndSession(ByVal SessionID As String) As Integer Dim SessionTime As Integer SessionTime = ec.Logout(SessionID)
Return SessionTime End Function Private Function ShowException(ByVal ex As SoapException) As ErrorInfo Dim doc As New XmlDocument Dim Node As XmlNode ShowException = New ErrorInfo doc.LoadXml(ex.Detail.OuterXml) Node = doc.DocumentElement.SelectSingleNode("ErrorInfo") ShowException.ErrorCode = _ CInt(Node.SelectSingleNode("ErrorCode").InnerText) ShowException.ErrorString = _ Node.SelectSingleNode("ErrorString").InnerText ShowException.ErrorItem = _ Node.SelectSingleNode("ErrorItem").InnerText ShowException.ErrorMessage = _ Node.SelectSingleNode("ErrorMessage").InnerText End Function End Class

EventID: 1003

See Also

UserPassword()


© 2008-2011, Loren Data Corp.
All rights reserved.
ECGrid is a registered service mark of Loren Data Corp.
ECGridOS is a service mark of Loren Data Corp.