Bir konsol uygulamasında kullanıcıdan istenen yazı sonucu o kodu çalıştırmak istiyorum. Yani eğer kullanıcı konsola "about" girerse "Apps.About.Start();" komutunun çalışmasını istiyorum. Aynı şey başka komutlar için de olur. Yani kullanıcı "deneme" girerse "Apps.Deneme.Start();" komutunun çalışmasını istiyorum. Kodum şu şekilde:
[CODE lang="csharp" title="KODUM"]
public static void runCMD(string lineCmd)
{
if (lineCmd == "")
{
Console.WriteLine("Blank command. Use ? command to get help.");
}
else
{
//KODLAR BURAYA GELSİN
}
/*YAPMAK İSTEDİĞİM BUNLARI KISALTMAK. ÖRNEK OLARAK AZ VERDİM AMA YAKLAŞIK 50 TANE KOMUT VAR.
string input = lineCmd;
if (input == "about")
{
Apps.About.Start();
}
else if (input == "echo")
{
Apps.Echo.Start();
}
else if (input == "math")
{
Apps.Math.Start();
}*/
}
[/CODE]
[CODE lang="csharp" title="KODUM"]
public static void runCMD(string lineCmd)
{
if (lineCmd == "")
{
Console.WriteLine("Blank command. Use ? command to get help.");
}
else
{
//KODLAR BURAYA GELSİN
}
/*YAPMAK İSTEDİĞİM BUNLARI KISALTMAK. ÖRNEK OLARAK AZ VERDİM AMA YAKLAŞIK 50 TANE KOMUT VAR.
string input = lineCmd;
if (input == "about")
{
Apps.About.Start();
}
else if (input == "echo")
{
Apps.Echo.Start();
}
else if (input == "math")
{
Apps.Math.Start();
}*/
}
[/CODE]
Son düzenleyen: Moderatör: