为uint我很新的C#出于某种原因,我的电话号码不会转换为我的生活。我的代码是:不能把字符串转换在C#
foreach(var descriptionid in test.items)
{
ulong description = Convert.ToUInt32(descriptionid.Value.descriptionid);
Console.WriteLine(description);
}
任何帮助真的很感激!
编辑:这是错误消息:
string number = descriptionid.Value.descriptionid.ToString();
string[] nums = number.Split ('_');
和:所有你需要摆脱了存在于数字的末尾的“_0”的,这样的http://gyazo.com/ed87941f4c8226ad6ebfd60879a5f173
请告诉我问题和错误消息? – Peyman
Noo,它已经是一个字符串,我需要将它转换为uint – ETurns
根据它们的功能命名变量。无论如何,'descriptionid.Value.descriptionid'确实不是一个好习惯。关于你的问题:调试它,进入foreach循环,了解这个值等于什么时候中断。顺便说一句,long是Int64而不是Int32。 –