⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soapheaderauthentication.asmx

📁 This is a book about vb.you could learn this from this book
💻 ASMX
字号:
<%@ 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -