0
J'ai une URL, disons http://www.example.com
. Parfois, j'ai besoin d'envoyer HTTP et d'autres fois, j'ai besoin d'envoyer HTTPS. Pour cela, je créé un ENUM:Créer un équivalent enum ou enum qui renvoie une chaîne (enum returns int) dans .NET
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
Maintenant, quand je reçois la valeur de retour de ProtocolType, il retourne une valeur entière ENUM. Comment puis-je obtenir le nom de chaîne d'une énumération.
Dim targetUri As String = setting.protocolType & "://www.example.com"
lot Merci. je pensais qu'il va convertir comme 2 en "2" int en string (int) –