我有一个网址,比方说http://www.example.com
。有时,我需要发送HTTP和其他时间,我需要发送HTTPS。为此,我创建了一个枚举:
Private _protocol As Protocol
Enum Protocol
HTTP
HTTPS
End Enum
Public Property protocolType() As Protocol
Get
Return _protocol
End Get
Set(ByVal value As Protocol)
_protocol = value
End Set
End Property
现在,当我从protocoltype返回值时,它返回一个整数值作为枚举。如何获取枚举的字符串名称。
Dim targetUri As String = setting.protocolType & "://www.example.com"