This is a good answer,isnt it?
If there is no alternative in C#,we can use System("pause") provided in msvcrt.dll,maybe it is not the best or the easiest way to do that,but we can learn from it,as we will know if we want to use those system calls in a C/C++ program,we can import msvcrt.dll :)
I am also a beginner at C#,and I reached here with google when I searched answers to my question,I think dxfoo is helpful to us,isnt he?
Quote:
Originally Posted by
dxfoo
You can interop it with msvcrt.dll, I believe. Ah, here's my old reply to the question:
You have to pinvoke this C function into your C# application. Luckily, this process is very easy. There are a few steps:
1) Insert System.Runtime.InteropServices to your using clauses.
2) Insert this line in your class (usually in the first few lines)
[DllImport("msvcrt.dll")]
static extern bool system(string str);
3) In that same class, simply write this:
system("pause");
Hope that helps! It's not the best solution in C# to go about the problem, but hey, it's a solution.