Console apps

  • Thread starter Thread starter Alexandre Gomes
  • Start date Start date
A

Alexandre Gomes

I've been searching for a clue for this but can't find one.

Is possible to create an aplication with something like:

"Decompressing... x%"

Where the x will be changing with the evolution of the decompression in
this case.
In this case I used decompressing but it could be anything like in Linux
or Dos where u can have an application in textmode.

Thanks
 
If you are looking to update the x in place and not print a new line
for each update, I believe you'll need to pinvoke some of the console
API functions, as .NET 1.1 doesn't expose these.

See:

Console Functions:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/console_functions.asp

Console Enhancements:
http://www.codeproject.com/csharp/winconsole.asp?df=100&forumid=16021&exp=0&select=751480

Also, http://pinvoke.net/ is a resource to check out if you are
accessing the Win32 API from .NET.
 
Greetings.

Uzytkownik "Alexandre Gomes said:
Is possible to create an aplication with something like:

"Decompressing... x%"

Where the x will be changing with the evolution of the decompression in
this case.

You can use something like this:

Console.Write("Decompresing: --%");

for (int i=0; i<100; ++i)

{

Console.Write("\b\b\b{0,2}%",i);

Thread.Sleep(200);

}
 
Back
Top