Fejl i kode
hejsa.Sidder og er ved at lære det hel basale i c# men får en fejl i den her kode
using System;
namespace if_else
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
string myInput;
int myInt;
Console.Write("Please enter a number: ");
myInput = Console.ReadLine();
myInt = Int32.Parse("myInput");
if(myInt > 0)
{
Console.WriteLine("Your number{0} is greater that zero.", myInt);
}
Console.ReadLine();
}
}
}
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.
Den fejl får jeg under afvikling af consol programmet
