該Services的作用是用來驗證用戶的登陸
引用地址 http://<Site>/_vti_bin/Authentication.asmx
說下Authentication.Login Method 的使用
Visual Basic (Usage)
Dim instance As Authentication Dim username As String Dim password As String Dim returnValue As LoginResult returnValue = instance.Login(username, password)
- Public Function Logon(ByVal SharePointHost As String, ByVal username As String, ByVal password As String, ByRef mycookieContainer As System.Net.CookieContainer) As Boolean Implements SPInferface.Logon
- Dim Au As New Authentication.Authentication()
- Au.CookieContainer = New CookieContainer()
- Au.Url = SharePointHost & "/" & AuthenticationServiceName
- Dim LoginResu As New Authentication.LoginResult()
- Try
- LoginResu = Au.Login(username, password)
- Catch ex As Exception
- Return False
- End Try
- If LoginResu.ErrorCode = Authentication.LoginErrorCode.NoError Then
- mycookieContainer = Au.CookieContainer
- Return True
- End If
- Return False
- End Function
這裏如果登陸成功的話,會有一個byref的參數返回到客戶端
Au.CookieContainer
改參數的作用就是調用其他 webservices的時候 將該參數賦予給其他webserivce的對象,這樣該對象就會具備剛剛登陸用戶的權限信息....