0
SOLVED - Translation to CMD? Console / Convert does NOT work
SOLVED for myself ISSUE missing libraries SOLUTION manually type in additional libraries autofilled from Visual Studio Using Notepad++ and Dev CMD Prompt for this. I cannot get Convert to work for me at all. This is what I have: string userMiles; int milesToConvert; WriteLine ("How many miles would you like to convert?"); userMiles = ReadLine (); milesToConvert = Convert.ToInt32(userMiles); WriteLine ("You entered {0}.", milesToConvert); And no matter how I try to enter it, convert will not work.
4 odpowiedzi
+ 2
This code works for me:
string userMiles;
int milesToConvert;
Console.WriteLine ("How many miles would you like to convert?");
userMiles = Console.ReadLine ();
milesToConvert = Convert.ToInt32(userMiles);
Console.WriteLine ("You entered {0}.", milesToConvert);
+ 1
You need to call the WriteLine() and the ReadLine() methods from its parent class Console.
0
If I attempt to use anything being led by Console or Convert, Cmd tells me it does not exist in the current context
- 1
Follow Zen's code, but Pay attention to the white/blank spaces between the method name and the parenthesis.
You have to call the method By invoking the parent Class or module, in this case is Console:
Console.WriteLine();
Console.ReadLine();
Console.Write();