System.Xml.XmlConvert.ToInt64 C# (CSharp) Method

ToInt64() public static method

public static ToInt64 ( string s ) : System.Int64
s string
return System.Int64
        public static Int64 ToInt64(string s)
        {
            return Int64.Parse(s, NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite, NumberFormatInfo.InvariantInfo);
        }

Usage Example

示例#1
0
 public static long ToInt64(string value)
 {
     try
     {
         return(XmlConvert.ToInt64(value));
     }
     catch (ArgumentException exception)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "Int64", exception));
     }
     catch (FormatException exception)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "Int64", exception));
     }
     catch (OverflowException exception)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "Int64", exception));
     }
 }
All Usage Examples Of System.Xml.XmlConvert::ToInt64