Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting string value from enum
Message
De
30/07/2008 17:15:28
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
30/07/2008 17:12:52
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01335097
Message ID:
01335369
Vues:
10
Thanks Scott,

That translates pretty close to what I ended up with. I haven't been able to test it yet, but your message confirms it should work.
Tim

>Hi Tim
>
>Here's a version in VB.Net....TransferType is the enum.
>
> Public Shared Function GetTransferType(ByVal value As String) As TransferType
> Dim theTransferType As TransferType
>
> Try
> theTransferType = CType(System.Enum.Parse(GetType(TransferType), value, True), TransferType)
> Catch ex As Exception
> theTransferType = TransferType.Unknown
> End Try
>
> Return theTransferType
> End Function
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform