Konsol Uygulaması - Kendi cmd uygulamanızı yaratın !
Kaynak Kodu :
// C# Programlama Dili
// zafercavdar
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace MyCMD
{
class Program
{
[DllImport("user32.dll")]
public static extern void LockWorkStation();
static void Main(string[] args)
{
string user;
Console.Write("Username : ");
user = Console.ReadLine();
Console.Title = "console>>" + user;
while (true)
{
string password = "admin";
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
ConsoleKeyInfo consoleKeys = new ConsoleKeyInfo();
Console.Write("Enter your Password : ");
string storeUserInput = "";
while (true)
{
consoleKeys = Console.ReadKey(true);
if (consoleKeys.Key == ConsoleKey.Enter)
{
break;
}
else
{
storeUserInput += consoleKeys.KeyChar;
Console.Write("*");
}
}
if (storeUserInput == password)
{
Console.BackgroundColor = ConsoleColor.Blue;
Console.WriteLine("\nPassword.Check = true\nType '/help' to look at commands.\n");
Console.ResetColor();
while (true)
{
Console.Write("console>>" + user + "> : ");
string com = Console.ReadLine();
if (com == "admin")
{
proc.StartInfo.FileName = @"C:\Users\ZAF\Desktop\Projects\MyCMD\MyCMD.sln";
proc.Start();
//Environment.Exit(0);
}
else if (com == "/help")
{
Console.WriteLine("---Type 'admin' to view source code and kill itself.");
Console.WriteLine("---Type 'copyright' to view copyright text.");
Console.WriteLine("---Type 'explorer' to run explorer.exe");
Console.WriteLine("---Type 'shutdown' to shutdown computer.");
Console.WriteLine("---Type 'restart' to restart computer.");
Console.WriteLine("---Type 'hibernate' to hibernate computer.");
Console.WriteLine("---Type 'logoff' to logoff.");
Console.WriteLine("---Type 'lock' to lock the screen.");
Console.WriteLine("---Type 'kill' to kill process.");
Console.WriteLine("---Type 'visual' to run Visual Studio 2008.");
Console.WriteLine("---Type 'firefox' || 'mozilla' to run Mozilla Firefox.");
Console.WriteLine("---Type 'chrome' to run Google Chrome.");
Console.WriteLine("---Type 'wiki' to search on Wikipedia.");
Console.WriteLine("---Type 'google' to search on Google.");
Console.WriteLine("---Type 'bing' to Search on Bing.");
Console.WriteLine("---Type 'hotmail' || 'hot' to open login page of Hotmail.");
Console.WriteLine("---Type 'gmail' || 'googlemail' to open login page of GMail.");
Console.WriteLine("---Type 'tureng' || 'sozluk' to search & translate a word in TurEng.com");
Console.WriteLine("---Type 'torrent' || 'torrentz' to search torrent file in Torrentz.Eu");
Console.WriteLine("---Type 'face' || 'facebook' || 'feys' to open login page of Facebook.");
Console.WriteLine("---Type 'twitter' || 'twit' to open login page of Twitter.");
Console.WriteLine("---Type 'youtube' || 'utube' for video search on YouTube.");
Console.WriteLine("---Type 'explorer' to run explorer.exe");
Console.WriteLine("---Type 'sro' || 'silkroad' to run silkroad.exe");
Console.WriteLine("---Type 'cs' || 'cs16' || 'counter' to run Counter Strike 1.6");
Console.WriteLine("---Type 'aml' to run AML Registry Cleaner.");
Console.WriteLine("---Type 'quit' and password to quit.");
}
else if (com == "copyright")
{
Console.WriteLine("Copyright 2012 ® Zafer Cavdar.\nAll rights reserved.");
}
else if (com == "explorer")
{
proc.StartInfo.FileName = "explorer";
proc.Start();
}
else if (com == "cs" || com == "cs16" || com == "counter")
{
proc.StartInfo.FileName = "C:\\Users\\ZAFER\\Desktop\\Oyunlar\\Portable_CS1.6.exe";
proc.Start();
}
else if (com == "aml")
{
proc.StartInfo.FileName = "C:\\Program Files (x86)\\AML Products\\Registry Cleaner\\regclean.exe";
proc.Start();
}
else if (com == "sro" || com == "silkroad" || com == "psro")
{
proc.StartInfo.FileName = @"C:\Users\ZAF\Downloads\Compressed\NewWorldSRO\edxSilkroadloader6.exe";
proc.Start();
}
else if (com == "visual")
{
proc.StartInfo.FileName = "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe";
proc.Start();
}
else if (com == "chrome")
{
proc.StartInfo.FileName = "C:\\Users\\ZAFER\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe";
proc.Start();
}
else if (com == "firefox" || com == "mozilla")
{
proc.StartInfo.FileName = "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe";
proc.Start();
}
else if (com == "wiki")
{
Console.Write("Search it in Wikipedia : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://tr.wikipedia.org/w/index.php?title=%C3%96zel%3AAra&search=" + com2);
}
else if (com == "tureng" || com == "sozluk")
{
Console.Write("Word : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://tureng.com/search/" + com2);
}
else if (com == "torrent" || com == "torrentz")
{
Console.Write("Torrent Name : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://torrentz.eu/search?f=" + com2);
proc.StartInfo.FileName = @"C:\Program Files (x86)\uTorrent\uTorrent.exe";
proc.Start();
}
else if (com == "google")
{
Console.Write("Google Search : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://www.google.com/search?q=" + com2);
}
else if (com == "bing")
{
Console.Write("Bing Search : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://www.bing.com/search?q=" + com2);
}
else if (com == "face" || com == "facebook" || com == "feys")
{
System.Diagnostics.Process.Start("http://www.facebook.com");
}
else if (com == "twitter" || com == "twit")
{
System.Diagnostics.Process.Start("http://www.twitter.com");
}
else if (com == "vortex" || com == "poke")
{
System.Diagnostics.Process.Start(@"http://pokemonvortex.org/login.php");
}
else if (com == "hotmail" || com == "hot")
{
System.Diagnostics.Process.Start(@"https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1326975722&rver=6.1.6206.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fdefault.aspx&lc=1055&id=64855&mkt=tr-tr&cbcxt=mai&snsc=1");
}
else if (com == "gmail" || com == "googlemail")
{
System.Diagnostics.Process.Start(@"https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1<mpl=default<mplcache=2");
}
else if (com == "youtube" || com == "utube")
{
Console.Write("YouTube Video Search : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://www.youtube.com/results?search_query=" + com2);
}
else if (com == "shutdown")
{
Console.Write("Countdown Time (in seconds) : ");
int time1 = Console.Read();
//System.Diagnostics.Process.Start("shutdown", "/s /t 100");
}
else if (com == "lock")
{
LockWorkStation();
}
else if (com == "hibernate")
{
System.Diagnostics.Process.Start("shutdown", "/h");
}
else if (com == "restart")
{
System.Diagnostics.Process.Start("shutdown", "/r");
}
else if (com == "logoff")
{
System.Diagnostics.Process.Start("shutdown", "/l");
}
else if (com == "kill")
{
Console.Write("Process Name : ");
string com2 = Console.ReadLine();
foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses())
if (p.ProcessName == com2)
p.Kill();
Console.WriteLine("'" + com2 + "' Succesfully killed.");
}
else if (com == "quit")
{
ConsoleKeyInfo consoleKeys2 = new ConsoleKeyInfo();
Console.Write("Enter your Password : ");
string storeUserInput2 = "";
while (true)
{
consoleKeys2 = Console.ReadKey(true);
if (consoleKeys2.Key == ConsoleKey.Enter)
{
break;
}
else
{
storeUserInput2 += consoleKeys2.KeyChar;
Console.Write("*");
}
}
if (storeUserInput2 == password)
Environment.Exit(0);
else
Console.WriteLine("\nInvalid Password.");
}
else
{
//proc.StartInfo.FileName = com;
//proc.Start();
//Console.WriteLine("'" + com + "' is not recognized as an internal or external command, operable program or batch file.");
Console.WriteLine("'" + com + "' is not recognized as an internal or external command.");
}
Console.WriteLine();
}
}
else
{
Console.BackgroundColor = ConsoleColor.Red;
Console.WriteLine("\nInvalid Password.");
Console.ResetColor();
}
}
}
}
}
// zafercavdar
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace MyCMD
{
class Program
{
[DllImport("user32.dll")]
public static extern void LockWorkStation();
static void Main(string[] args)
{
string user;
Console.Write("Username : ");
user = Console.ReadLine();
Console.Title = "console>>" + user;
while (true)
{
string password = "admin";
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
ConsoleKeyInfo consoleKeys = new ConsoleKeyInfo();
Console.Write("Enter your Password : ");
string storeUserInput = "";
while (true)
{
consoleKeys = Console.ReadKey(true);
if (consoleKeys.Key == ConsoleKey.Enter)
{
break;
}
else
{
storeUserInput += consoleKeys.KeyChar;
Console.Write("*");
}
}
if (storeUserInput == password)
{
Console.BackgroundColor = ConsoleColor.Blue;
Console.WriteLine("\nPassword.Check = true\nType '/help' to look at commands.\n");
Console.ResetColor();
while (true)
{
Console.Write("console>>" + user + "> : ");
string com = Console.ReadLine();
if (com == "admin")
{
proc.StartInfo.FileName = @"C:\Users\ZAF\Desktop\Projects\MyCMD\MyCMD.sln";
proc.Start();
//Environment.Exit(0);
}
else if (com == "/help")
{
Console.WriteLine("---Type 'admin' to view source code and kill itself.");
Console.WriteLine("---Type 'copyright' to view copyright text.");
Console.WriteLine("---Type 'explorer' to run explorer.exe");
Console.WriteLine("---Type 'shutdown' to shutdown computer.");
Console.WriteLine("---Type 'restart' to restart computer.");
Console.WriteLine("---Type 'hibernate' to hibernate computer.");
Console.WriteLine("---Type 'logoff' to logoff.");
Console.WriteLine("---Type 'lock' to lock the screen.");
Console.WriteLine("---Type 'kill' to kill process.");
Console.WriteLine("---Type 'visual' to run Visual Studio 2008.");
Console.WriteLine("---Type 'firefox' || 'mozilla' to run Mozilla Firefox.");
Console.WriteLine("---Type 'chrome' to run Google Chrome.");
Console.WriteLine("---Type 'wiki' to search on Wikipedia.");
Console.WriteLine("---Type 'google' to search on Google.");
Console.WriteLine("---Type 'bing' to Search on Bing.");
Console.WriteLine("---Type 'hotmail' || 'hot' to open login page of Hotmail.");
Console.WriteLine("---Type 'gmail' || 'googlemail' to open login page of GMail.");
Console.WriteLine("---Type 'tureng' || 'sozluk' to search & translate a word in TurEng.com");
Console.WriteLine("---Type 'torrent' || 'torrentz' to search torrent file in Torrentz.Eu");
Console.WriteLine("---Type 'face' || 'facebook' || 'feys' to open login page of Facebook.");
Console.WriteLine("---Type 'twitter' || 'twit' to open login page of Twitter.");
Console.WriteLine("---Type 'youtube' || 'utube' for video search on YouTube.");
Console.WriteLine("---Type 'explorer' to run explorer.exe");
Console.WriteLine("---Type 'sro' || 'silkroad' to run silkroad.exe");
Console.WriteLine("---Type 'cs' || 'cs16' || 'counter' to run Counter Strike 1.6");
Console.WriteLine("---Type 'aml' to run AML Registry Cleaner.");
Console.WriteLine("---Type 'quit' and password to quit.");
}
else if (com == "copyright")
{
Console.WriteLine("Copyright 2012 ® Zafer Cavdar.\nAll rights reserved.");
}
else if (com == "explorer")
{
proc.StartInfo.FileName = "explorer";
proc.Start();
}
else if (com == "cs" || com == "cs16" || com == "counter")
{
proc.StartInfo.FileName = "C:\\Users\\ZAFER\\Desktop\\Oyunlar\\Portable_CS1.6.exe";
proc.Start();
}
else if (com == "aml")
{
proc.StartInfo.FileName = "C:\\Program Files (x86)\\AML Products\\Registry Cleaner\\regclean.exe";
proc.Start();
}
else if (com == "sro" || com == "silkroad" || com == "psro")
{
proc.StartInfo.FileName = @"C:\Users\ZAF\Downloads\Compressed\NewWorldSRO\edxSilkroadloader6.exe";
proc.Start();
}
else if (com == "visual")
{
proc.StartInfo.FileName = "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe";
proc.Start();
}
else if (com == "chrome")
{
proc.StartInfo.FileName = "C:\\Users\\ZAFER\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe";
proc.Start();
}
else if (com == "firefox" || com == "mozilla")
{
proc.StartInfo.FileName = "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe";
proc.Start();
}
else if (com == "wiki")
{
Console.Write("Search it in Wikipedia : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://tr.wikipedia.org/w/index.php?title=%C3%96zel%3AAra&search=" + com2);
}
else if (com == "tureng" || com == "sozluk")
{
Console.Write("Word : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://tureng.com/search/" + com2);
}
else if (com == "torrent" || com == "torrentz")
{
Console.Write("Torrent Name : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://torrentz.eu/search?f=" + com2);
proc.StartInfo.FileName = @"C:\Program Files (x86)\uTorrent\uTorrent.exe";
proc.Start();
}
else if (com == "google")
{
Console.Write("Google Search : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://www.google.com/search?q=" + com2);
}
else if (com == "bing")
{
Console.Write("Bing Search : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://www.bing.com/search?q=" + com2);
}
else if (com == "face" || com == "facebook" || com == "feys")
{
System.Diagnostics.Process.Start("http://www.facebook.com");
}
else if (com == "twitter" || com == "twit")
{
System.Diagnostics.Process.Start("http://www.twitter.com");
}
else if (com == "vortex" || com == "poke")
{
System.Diagnostics.Process.Start(@"http://pokemonvortex.org/login.php");
}
else if (com == "hotmail" || com == "hot")
{
System.Diagnostics.Process.Start(@"https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1326975722&rver=6.1.6206.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fdefault.aspx&lc=1055&id=64855&mkt=tr-tr&cbcxt=mai&snsc=1");
}
else if (com == "gmail" || com == "googlemail")
{
System.Diagnostics.Process.Start(@"https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1<mpl=default<mplcache=2");
}
else if (com == "youtube" || com == "utube")
{
Console.Write("YouTube Video Search : ");
string com2 = Console.ReadLine();
System.Diagnostics.Process.Start("http://www.youtube.com/results?search_query=" + com2);
}
else if (com == "shutdown")
{
Console.Write("Countdown Time (in seconds) : ");
int time1 = Console.Read();
//System.Diagnostics.Process.Start("shutdown", "/s /t 100");
}
else if (com == "lock")
{
LockWorkStation();
}
else if (com == "hibernate")
{
System.Diagnostics.Process.Start("shutdown", "/h");
}
else if (com == "restart")
{
System.Diagnostics.Process.Start("shutdown", "/r");
}
else if (com == "logoff")
{
System.Diagnostics.Process.Start("shutdown", "/l");
}
else if (com == "kill")
{
Console.Write("Process Name : ");
string com2 = Console.ReadLine();
foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses())
if (p.ProcessName == com2)
p.Kill();
Console.WriteLine("'" + com2 + "' Succesfully killed.");
}
else if (com == "quit")
{
ConsoleKeyInfo consoleKeys2 = new ConsoleKeyInfo();
Console.Write("Enter your Password : ");
string storeUserInput2 = "";
while (true)
{
consoleKeys2 = Console.ReadKey(true);
if (consoleKeys2.Key == ConsoleKey.Enter)
{
break;
}
else
{
storeUserInput2 += consoleKeys2.KeyChar;
Console.Write("*");
}
}
if (storeUserInput2 == password)
Environment.Exit(0);
else
Console.WriteLine("\nInvalid Password.");
}
else
{
//proc.StartInfo.FileName = com;
//proc.Start();
//Console.WriteLine("'" + com + "' is not recognized as an internal or external command, operable program or batch file.");
Console.WriteLine("'" + com + "' is not recognized as an internal or external command.");
}
Console.WriteLine();
}
}
else
{
Console.BackgroundColor = ConsoleColor.Red;
Console.WriteLine("\nInvalid Password.");
Console.ResetColor();
}
}
}
}
}