seeseekey.net - Invictus Deus Ex Machina

In .NET/Mono kann man ja eine Varia­ble nach ihrem Typ fragen:

bool test=true;
test.GetType().FullName;

Die Full­Name Eigen­schaft gibt dabei einen String mit der Bezeich­nung des Daten­ty­pes zurück. Da ich ab und an eine Liste die­ser „Full­na­mes“ benö­tigt, gibt es das ganze nun hier:

  • bool -> Boolean-> System.Boolean
  • byte -> Byte -> System.Byte
  • DateTime -> DateTime -> System.DateTime
  • dou­ble -> Dou­ble -> System.Double
  • int -> Int32 -> System.Int32
  • long -> Int64 -> System.Int64
  • short -> Int16 -> System.Int16
  • string -> String -> System.String
  • uint -> UInt32 -> System.UInt32
  • ulong -> UInt64 -> System.UInt64
  • ushort -> UInt16 -> System.UInt16

Es han­delt sich dabei jeweils um den C# Alias, die .NET Bezeich­nung und den Fullname.

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>