输入字符串的格式不正确 [英] Input String is not in a correct format
本文介绍了输入字符串的格式不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在以HEXADECIMAL格式获取子字符串并将它们转换为十进制整数。
为了显示,我需要将整数转换为字符串。
获得一些正确的值后,我收到错误。
输入字符串的格式不正确。
I am taking substrings in HEXADECIMAL Format and converting them in Decimal Integer.
For displaying, i need to convert intergers to strings.
After getting some correct values I am getting error.
Input String is not in a correct format.
string substring = string.Empty;
if (msg.Length > 57)
substring = msg.Substring(54, 2);
int decValue = int.Parse(substring, System.Globalization.NumberStyles.HexNumber);
string hexValue = decValue.ToString();
richTextBox1.AppendText (hexValue) ;
推荐答案
尝试调试代码以查看您获得的文本这个错误。
这将帮助您纠正数据(或代码)的问题。
Try debugging your code to see for what text you get this error.
This will help you correct issues with data (or your code).
这篇关于输入字符串的格式不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文