简体   繁体   English

mscorlib.dll中发生了'System.FormatException'类型的未处理异常

[英]An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll

using Org.BouncyCastle.Math;
    string p = "E7A69EBDF105F2A6BBDEAD7E798F76A209AD73FB466431E2E7352ED262F8C558F10BEFEA977DE9E21DCEE9B04D245F300ECCBBA03E72630556D011023F9E857F";
    BigInteger P= new BigInteger(p);

throwing Exception 抛出异常

System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffe
r& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo in
fo)
   at System.Int32.Parse(String s, NumberStyles style)
   at Org.BouncyCastle.Math.BigInteger..ctor(String str, Int32 radix)
   at Org.BouncyCastle.Math.BigInteger..ctor(String value)

what's wrong here? 怎么了

如果您的数字字符串为十六进制,则需要在构造函数中将基数指定为:

BigInteger P = new BigInteger(p,16); 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 mscorlib.dll中发生了未处理的“System.FormatException”类型异常 - An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll “ mscorlib.dll中发生了'System.FormatException'类型的未处理的异常” - “An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll” mscorlib.dll中发生了'System.FormatException'类型的未处理的异常其他信息:输入字符串的格式不正确 - An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Additional information: Input string was not in a correct format 尝试解析DateTime时-mscorlib.dll中发生了'System.FormatException'类型的未处理异常 - When trying to parse DateTime - An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll 在C#中将十进制转换为十六进制,并出现错误“ mscorlib.dll中发生了'System.FormatException'类型的未处理异常” - decimal to hexadecimal in c# with mistake “An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll” mscorlib.dll中发生“ System.FormatException”类型的未处理异常,被卡住 - An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll, stuck mscorlib.dll 中发生了类型为“System.FormatException”的未处理异常 谁能帮我解决这个错误? - An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Can anyone help me with this error? c# 中的运行时错误 - mscorlib.dll 中发生类型为“System.FormatException”的未处理异常 - Run-time error in c# - An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll mscorlib.dll中发生类型'System.FormatException'的异常,但未在用户代码中处理 - An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in the user code mscorlib.dll 中出现“System.FormatException”类型的异常,但未在用户代码中处理 - An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM