The User 0
Hectopat
- Katılım
- 14 Eylül 2020
- Mesajlar
- 2.119
- Çözümler
- 42
Daha fazla
- Sistem Özellikleri
- HP Laptop 15-da1083nt
Intel Core i5-8265U @ 1.60GHz
Intel UHD Graphics 620
NVidia GeForce MX130
WD NVMe 480GB
A-Data 8GB CL17 2400MHz
HP 22es 1080p 60Hz
HyperX PulseFire Raid
- Cinsiyet
- Erkek
- Meslek
- Öğrenci
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: