I'm trying to create a geometric graph looking for a Txt file but at the start of the application this error appears I'm half beginner and I'm having trouble finding the solution
Your error is because you are trying to convert a nonexistent value to type INT
, so you get the error;
Run-time exception (line XXX): Input string was not in a correct format.
Stack Trace:
One way to fix this would be to check if it really is a value of type int before converting it, this can be done as follows.
int number;
bool result = Int32.TryParse(texto10, out number);
See more details here , the commented lines is the example of your error.
Check the contents of the string before converting it to Int32, the numeric format can not contain spaces or commas, or even be empty.
place a breakpoint on this line to check the value of the variable at runtime.