ParseLong() public static méthode

Attempt to parse a string representation of a long.
public static ParseLong ( string value ) : long
value string
Résultat long
Exemple #1
0
        public static long ReadInt64(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("long", reader);

            if (value is long || value is int || value is short || value is byte)
            {
                return((long)value);
            }
            if (value is string)
            {
                return(PrimitiveParser.ParseLong((string)value));
            }
            throw PrimitiveParser.CreateProtocolViolationException("long", value);
        }
        public static long ReadInt64(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("long", reader);

            if (value is long || value is int || value is short || value is byte)
            {
                return((long)value);
            }
            if (value is string)
            {
                return(PrimitiveParser.ParseLong((string)value));
            }
            PrimitiveParser.InvalidConversion("long", value);
            return(0);
        }