soapheaderauthentication.asmx
来自「This is a book about vb.you could learn 」· ASMX 代码 · 共 26 行
ASMX
26 行
<%@ WebService Language="VB" Class="SecureWebService" %>
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
Public Class Authentication : Inherits SoapHeader
Public User As String
Public Password As String
End Class
Public Class SecureWebService : Inherits WebService
Public authentication As Authentication
<WebMethod> _
<SoapHeader("authentication")> _
Public Function ValidUser() As String
If User.IsInRole("Customer") Then
Return "User is in the Customer role..."
Else If User.Identity.IsAuthenticated Then
Return "User is valid..."
Else
Return "Not authenticated"
End If
End Function
End Class
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?