المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : convert.ToInt32



C# Programming
05-07-2009, 09:07 AM
line = "==XXXT08746=05/01/09 15:13 112 4 IT 0:01'22 0 #2 ";
string Duration = line.Substring(64, 9).Replace("#","[#]");
int s = Convert.ToInt32(Duration.Substring(1, 2));
int s = Convert.ToInt32(Duration.Substring(1, 2));
int y = Convert.ToInt32(Duration.Substring(3, 2));
int l = Convert.ToInt32(Duration.Substring(6, 2));
int NDura = s + y + l;

---->>>> Error System.FormatException: Input string was not in a correct format.
So what should I do with this ?