473,569 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Console Application

Does anyone know how to do a "Clear Screen" (i.e. cls)
with a C# Console Application?
Nov 15 '05 #1
7 3443
Not really, but you can always use

for(int i = 0; i < 80; i++)
{
Console.WriteLi ne("");
}

Or any number of lines really, 80 is max on XP, but you can still scroll
back further.
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
For a laugh, try web browsing with Opera's User Mode with Nostalgia enabled
Nov 15 '05 #2
Morten Wennevik <Mo************ @hotmail.com> wrote:
Not really, but you can always use

for(int i = 0; i < 80; i++)
{
Console.WriteLi ne("");
}

Or any number of lines really, 80 is max on XP, but you can still scroll
back further.


What do you mean by "80 is max on XP"?

I've just created a console window which is 93 lines tall, for
instance...

There is a more advanced console library out there somewhere, but I can
never remember its name...

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3
I seem to remember 80 was max you could select (maybe in Windows ME).
However, since you can scroll the command window in Win XP, max seems to
be more like 300.
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
For a laugh, try web browsing with Opera's User Mode with Nostalgia enabled
Nov 15 '05 #4
Morten Wennevik <Mo************ @hotmail.com> wrote:
I seem to remember 80 was max you could select (maybe in Windows ME).
However, since you can scroll the command window in Win XP, max seems to
be more like 300.


No - the size of the *buffer* can be set to much higher than that. I
have it set to 3000 on my box. The size of the window itself is just
limited by your display/font I believe. The limit for the buffer is
9999 (through experimentation just now; it could well be higher if you
tweak things programmaticall y instead of through the console window's
properties).

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #5
Is there a way to send a "cls" cmd to the Console window
instead? I'm new to C# and I don't know all the library's
I have at my disposal yet.

-----Original Message-----
Not really, but you can always use

for(int i = 0; i < 80; i++)
{
Console.WriteLi ne("");
}

Or any number of lines really, 80 is max on XP, but you can still scrollback further.
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/For a laugh, try web browsing with Opera's User Mode with Nostalgia enabled.

Nov 15 '05 #6
Interesting. Haven't done much console buffering since the early days
where you scrolled back by tweaking the screen memory, but you couldn't
scroll very far until you did a full circle.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
For a laugh, try web browsing with Opera's User Mode with Nostalgia enabled
Nov 15 '05 #7
Scott <an*******@disc ussions.microso ft.com> wrote:
Is there a way to send a "cls" cmd to the Console window
instead? I'm new to C# and I don't know all the library's
I have at my disposal yet.


Not with the plain Console. However, there are some libraries
available. See

http://www.c-sharpcorner.com/Code/20...SysConsole.asp
(Fairly basic functionality)

http://www.codeproject.com/csharp/winconsole.asp
(Looks much more fully functioned)

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2307
by: Job Lot | last post by:
How can I terminate console application in Try…Catch…Finally…End Try block so that code in Finally gets executed. If I use End statement Finally does not get executed. Following is my code written in Console Application. Module Module1 Sub Main() Call Testing()
2
10976
by: Chris | last post by:
Hi, Currently, I have a console application written in C# and an unmanaged legacy DLL written in VC++ 6.0. In the DLL's previous application, when an event occurs in the DLL, a windows message would be sent to the host GUI application via PostMessage to WM_USER + X. The GUI application would then execute a function to retrieve data from...
7
4378
by: ajikoe | last post by:
Hello All, It is said that : Enabling the console window is easy. From Microsoft Visual Studio®, right-click on the project and choose Properties. Change the output type from Windows Application to Console Application. I use C# Standard Edition and I can't change the output type files from Windows Application to Console Application. I...
5
11207
by: Barry Mossman | last post by:
Hi, can I detect whether my class is running within the context of a Console application, vs say a WinForm's application ? also does anyone know whether the compiler or runtime is smart enough to avoid the overhead of writing to the console if it is not visible, eg I am running inside a WinForm application. thanks
3
15018
by: inpreet | last post by:
I am trying to build a console application in C#.Net. This application is suppose to run in background without user interaction. How can I hide console to appear?
8
18629
by: Alison | last post by:
Hi, Al I am trying to design a user interface which provides both menus and toolbars for some users to click on whatever they want to do, at the same time, I would like to have a console window available in the same form for users to enter commands and display outputs if some prefer to use character based user interface. I would like to implement...
0
1594
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is that when I ran it and looked at memory usage (in Windows task manager) it looked as if there was a very slow leak. To isolate the issue:
2
525
by: Jim Heavey | last post by:
Hello, I used VS 2005 to create a console application. Got the application working just fine. I then decided I would create a folder for each of my "console" applications within that project. I created a new folder and placed the working application under tht folder (This included the .config file, the driver .cs (void main) and the class...
4
5678
by: federico | last post by:
Hello, I am trying to setup a Visual Basic "Console" application for searching Outlook folders. To this end I am trying to implement a Handler for the Outlook.Application.AdvancedSearchComplete Event. The problem I have is that the application finishes and exits before the AdvanceSearch, so the Event Handler in never called. If I delay the...
0
2053
by: Stephen Thomas | last post by:
Hi there I wonder if any one has encountered this problem or can suggest what is wrong. I am trying the a procedure from the msn site but get the following message: Error 1 The type or namespace name 'LiveSearch' does not exist in the namespace 'ConsoleSampleWebSearch' (are you missing an assembly reference?) C:\Documents and...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.