Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C# System() ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Ax3l
Cheater
Reputation: 1

Joined: 22 May 2011
Posts: 37

PostPosted: Thu Jun 02, 2011 11:17 am    Post subject: C# System() ? Reply with quote

How would I use System() (like in C++) in C# (in a console window), without to much hassle ?
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Jun 02, 2011 1:49 pm    Post subject: Reply with quote

You don't. You shouldn't use system() in C++ either as it produces a lot of overhead.

What are you trying to do that is making you use system() like calls?

Basically everything you want to do from system can be done in .NET already:

Code:

            // Set the console title..
            Console.Title = "Some different title..";

            // Change the console colors..
            Console.BackgroundColor = System.ConsoleColor.Blue;
            Console.ForegroundColor = System.ConsoleColor.Yellow;

            // Writing to the console..
            Console.WriteLine("Writing some text to the console..");

            // Reading a line from the console..
            string strReadLine = Console.ReadLine();
            Console.WriteLine(String.Format("You wrote:\r\n{0}", strReadLine));

            // Pause the console.. (given that you shouldn't do this anyway)
            Console.TreatControlCAsInput = true;
            Console.ReadKey();


Along with plenty of other things. Just type in Console. and see what drops down in the intellisense for other options.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Ax3l
Cheater
Reputation: 1

Joined: 22 May 2011
Posts: 37

PostPosted: Thu Jun 02, 2011 4:14 pm    Post subject: Reply with quote

Wiccaan wrote:
You don't. You shouldn't use system() in C++ either as it produces a lot of overhead.

What are you trying to do that is making you use system() like calls?

Basically everything you want to do from system can be done in .NET already:

Code:

            // Set the console title..
            Console.Title = "Some different title..";

            // Change the console colors..
            Console.BackgroundColor = System.ConsoleColor.Blue;
            Console.ForegroundColor = System.ConsoleColor.Yellow;

            // Writing to the console..
            Console.WriteLine("Writing some text to the console..");

            // Reading a line from the console..
            string strReadLine = Console.ReadLine();
            Console.WriteLine(String.Format("You wrote:\r\n{0}", strReadLine));

            // Pause the console.. (given that you shouldn't do this anyway)
            Console.TreatControlCAsInput = true;
            Console.ReadKey();


Along with plenty of other things. Just type in Console. and see what drops down in the intellisense for other options.


I want to call another console program
Back to top
View user's profile Send private message MSN Messenger
legoblock
How do I cheat?
Reputation: 0

Joined: 01 Jun 2011
Posts: 9

PostPosted: Thu Jun 02, 2011 5:43 pm    Post subject: Reply with quote

Code:
System.Diagnostics.Process p = new System.Diagnostics.Process();

p.EnableRaisingEvents = false;
p.StartInfo.FileName = "filename.exe";
p.Start();
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites