public enum MyType { Undef = 0, Type1 = 10, Type2 = 20, Type3 = 64 } // Variante 1 mit Parse string sType = "Type1"; MyType t = (MyType)Enum.Parse(typeof(MyType), sType); // Variante 2 mit TryParse MyType a; string sType = "Type1"; // Inhalt von string "sType" bestimmen und in MyType wandeln // Ergebnis in "a" ausgeben if (Enum.TryParse<MyType->(sType, out a)) { ... }
Kategorien
-
Neueste Beiträge
- [SAP] Mailversand einrichten
- [SAP EWM] SAP EWM and SAP ERP integration via CIF
- [SAP] Nutzung der ALV-Anzeige im MM-Reporting
- [Raspberry Pi 4] Raspberry Pi als DNS Server
- [Raspberry Pi] SSH aktivieren
- [Raspberry Pi] Bootoptionen in der config.txt
- [Raspberry Pi 4] Bessere Youtube-Videoperformance in Google Chrome
- [Raspberry Pi 4] Direkt von SSD booten (ohne SD-Karte)
- [ABAP] Fixkontentabelle (T030) auslesen
- [SAPUI5] SAPUI5 Entwicklung mit SAP Business Application Studio (BAS)