(Console.BufferHeight) I can't see/scroll to see all the console output with Console.WriteLine










11















When I run this code, the number at the top of the output window is 99701. Why don't I get to see all the way through 1? I actually see all the numbers getting outputted, but on the console window, I can only SCROLL high enough to see 99701 (I'm guessing). I'm using Visual C# express on Vista Home. :D



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using utilities;

namespace Testing_Project
class Program
static void Main(string args)
List<string> myList = new List<string>();

for (int x = 0; x < 100000; x++)
myList.Add( x.ToString() );
foreach (string s in myList)
Console.WriteLine(s);


Console.Read();





Console.Write(s) does fine, but Console.Write( s+"n") does not. I'm guessing I can only scroll up through so many newlines?










share|improve this question
























  • +1 for your question, because a lot of people got it wrong ;)

    – Alfred Myers
    Sep 2 '09 at 21:58















11















When I run this code, the number at the top of the output window is 99701. Why don't I get to see all the way through 1? I actually see all the numbers getting outputted, but on the console window, I can only SCROLL high enough to see 99701 (I'm guessing). I'm using Visual C# express on Vista Home. :D



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using utilities;

namespace Testing_Project
class Program
static void Main(string args)
List<string> myList = new List<string>();

for (int x = 0; x < 100000; x++)
myList.Add( x.ToString() );
foreach (string s in myList)
Console.WriteLine(s);


Console.Read();





Console.Write(s) does fine, but Console.Write( s+"n") does not. I'm guessing I can only scroll up through so many newlines?










share|improve this question
























  • +1 for your question, because a lot of people got it wrong ;)

    – Alfred Myers
    Sep 2 '09 at 21:58













11












11








11








When I run this code, the number at the top of the output window is 99701. Why don't I get to see all the way through 1? I actually see all the numbers getting outputted, but on the console window, I can only SCROLL high enough to see 99701 (I'm guessing). I'm using Visual C# express on Vista Home. :D



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using utilities;

namespace Testing_Project
class Program
static void Main(string args)
List<string> myList = new List<string>();

for (int x = 0; x < 100000; x++)
myList.Add( x.ToString() );
foreach (string s in myList)
Console.WriteLine(s);


Console.Read();





Console.Write(s) does fine, but Console.Write( s+"n") does not. I'm guessing I can only scroll up through so many newlines?










share|improve this question
















When I run this code, the number at the top of the output window is 99701. Why don't I get to see all the way through 1? I actually see all the numbers getting outputted, but on the console window, I can only SCROLL high enough to see 99701 (I'm guessing). I'm using Visual C# express on Vista Home. :D



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using utilities;

namespace Testing_Project
class Program
static void Main(string args)
List<string> myList = new List<string>();

for (int x = 0; x < 100000; x++)
myList.Add( x.ToString() );
foreach (string s in myList)
Console.WriteLine(s);


Console.Read();





Console.Write(s) does fine, but Console.Write( s+"n") does not. I'm guessing I can only scroll up through so many newlines?







c# .net console.writeline






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 9 '12 at 13:40









Alfred Myers

5,54912761




5,54912761










asked Sep 2 '09 at 21:14









Gordon GustafsonGordon Gustafson

25.6k2297146




25.6k2297146












  • +1 for your question, because a lot of people got it wrong ;)

    – Alfred Myers
    Sep 2 '09 at 21:58

















  • +1 for your question, because a lot of people got it wrong ;)

    – Alfred Myers
    Sep 2 '09 at 21:58
















+1 for your question, because a lot of people got it wrong ;)

– Alfred Myers
Sep 2 '09 at 21:58





+1 for your question, because a lot of people got it wrong ;)

– Alfred Myers
Sep 2 '09 at 21:58












5 Answers
5






active

oldest

votes


















26














From .Net Framework 2.0 and beyond, you can change the buffer height from within your own program with Console.BufferHeight:




Console.BufferHeight = Int16.MaxValue - 1; // ***** Alters the BufferHeight *****
List<string> myList = new List<string>();
for (int x = 0; x < 100000; x++)
myList.Add(x.ToString());
foreach (string s in myList)
Console.WriteLine(s);



The maximum height is Int16.MaxValue - 1.






share|improve this answer























  • Hmm, indeed you can? Good to know. Still not enough for 100000 items though. :)

    – Botz3000
    Sep 2 '09 at 21:58











  • That gets me to 67235, but more importantly it explains the problem :D

    – Gordon Gustafson
    Sep 3 '09 at 23:34











  • Rock'n'Roll ! :D

    – Mehdi LAMRANI
    Jul 11 '12 at 19:54











  • a bit confusing that BufferHeight and BufferWidth are Int32 but only accept Int16 values. :/

    – cmxl
    Apr 14 '15 at 13:16


















11














300 seems to be your default console buffer size. This is a Windows setting and it is not related to your application.



You can change the console buffer size by creating a shortcut to the executable. Then right click on the shortcut and select Properties. Go in the Options tab and change the buffer size.



Seem that I didn't check that feature in a long time, but it seem to be modifiable now. See Alfred Myers answer






share|improve this answer




















  • 3





    It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11


















3














It is the console not your app.



As an alternative you can use Debug.WriteLine (System.Diagnostics) and use the Output window in Visual Studio. It has a much bigger buffer (just be sure to run a Debug build).






share|improve this answer























  • You can change the console's settings. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:13


















2














This has nothing to do with C#, but actually the output buffer in the command prompt is only 300 lines long by default. You can change that in the window settings, although maybe this is an opportunity to try implementing a "more" like feature, which breaks out of the loop every time a screenful of data is output. Then when you press a key, it outputs another screenful, etc.






share|improve this answer























  • It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:12


















2














You don't get to see anymore than that because the console does not buffer more than 300 rows by default. Use the settings dialog for the console to change this - I believe you can just start a command prompt and change them there, then run your program.



Alfred has already pointed out how your application can change the buffer height.






share|improve this answer




















  • 1





    Yes it is. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11











  • I stand corrected. I'll edit accordingly.

    – Michael Madsen
    Sep 3 '09 at 15:19










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f1370158%2fconsole-bufferheight-i-cant-see-scroll-to-see-all-the-console-output-with-con%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























5 Answers
5






active

oldest

votes








5 Answers
5






active

oldest

votes









active

oldest

votes






active

oldest

votes









26














From .Net Framework 2.0 and beyond, you can change the buffer height from within your own program with Console.BufferHeight:




Console.BufferHeight = Int16.MaxValue - 1; // ***** Alters the BufferHeight *****
List<string> myList = new List<string>();
for (int x = 0; x < 100000; x++)
myList.Add(x.ToString());
foreach (string s in myList)
Console.WriteLine(s);



The maximum height is Int16.MaxValue - 1.






share|improve this answer























  • Hmm, indeed you can? Good to know. Still not enough for 100000 items though. :)

    – Botz3000
    Sep 2 '09 at 21:58











  • That gets me to 67235, but more importantly it explains the problem :D

    – Gordon Gustafson
    Sep 3 '09 at 23:34











  • Rock'n'Roll ! :D

    – Mehdi LAMRANI
    Jul 11 '12 at 19:54











  • a bit confusing that BufferHeight and BufferWidth are Int32 but only accept Int16 values. :/

    – cmxl
    Apr 14 '15 at 13:16















26














From .Net Framework 2.0 and beyond, you can change the buffer height from within your own program with Console.BufferHeight:




Console.BufferHeight = Int16.MaxValue - 1; // ***** Alters the BufferHeight *****
List<string> myList = new List<string>();
for (int x = 0; x < 100000; x++)
myList.Add(x.ToString());
foreach (string s in myList)
Console.WriteLine(s);



The maximum height is Int16.MaxValue - 1.






share|improve this answer























  • Hmm, indeed you can? Good to know. Still not enough for 100000 items though. :)

    – Botz3000
    Sep 2 '09 at 21:58











  • That gets me to 67235, but more importantly it explains the problem :D

    – Gordon Gustafson
    Sep 3 '09 at 23:34











  • Rock'n'Roll ! :D

    – Mehdi LAMRANI
    Jul 11 '12 at 19:54











  • a bit confusing that BufferHeight and BufferWidth are Int32 but only accept Int16 values. :/

    – cmxl
    Apr 14 '15 at 13:16













26












26








26







From .Net Framework 2.0 and beyond, you can change the buffer height from within your own program with Console.BufferHeight:




Console.BufferHeight = Int16.MaxValue - 1; // ***** Alters the BufferHeight *****
List<string> myList = new List<string>();
for (int x = 0; x < 100000; x++)
myList.Add(x.ToString());
foreach (string s in myList)
Console.WriteLine(s);



The maximum height is Int16.MaxValue - 1.






share|improve this answer













From .Net Framework 2.0 and beyond, you can change the buffer height from within your own program with Console.BufferHeight:




Console.BufferHeight = Int16.MaxValue - 1; // ***** Alters the BufferHeight *****
List<string> myList = new List<string>();
for (int x = 0; x < 100000; x++)
myList.Add(x.ToString());
foreach (string s in myList)
Console.WriteLine(s);



The maximum height is Int16.MaxValue - 1.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 2 '09 at 21:56









Alfred MyersAlfred Myers

5,54912761




5,54912761












  • Hmm, indeed you can? Good to know. Still not enough for 100000 items though. :)

    – Botz3000
    Sep 2 '09 at 21:58











  • That gets me to 67235, but more importantly it explains the problem :D

    – Gordon Gustafson
    Sep 3 '09 at 23:34











  • Rock'n'Roll ! :D

    – Mehdi LAMRANI
    Jul 11 '12 at 19:54











  • a bit confusing that BufferHeight and BufferWidth are Int32 but only accept Int16 values. :/

    – cmxl
    Apr 14 '15 at 13:16

















  • Hmm, indeed you can? Good to know. Still not enough for 100000 items though. :)

    – Botz3000
    Sep 2 '09 at 21:58











  • That gets me to 67235, but more importantly it explains the problem :D

    – Gordon Gustafson
    Sep 3 '09 at 23:34











  • Rock'n'Roll ! :D

    – Mehdi LAMRANI
    Jul 11 '12 at 19:54











  • a bit confusing that BufferHeight and BufferWidth are Int32 but only accept Int16 values. :/

    – cmxl
    Apr 14 '15 at 13:16
















Hmm, indeed you can? Good to know. Still not enough for 100000 items though. :)

– Botz3000
Sep 2 '09 at 21:58





Hmm, indeed you can? Good to know. Still not enough for 100000 items though. :)

– Botz3000
Sep 2 '09 at 21:58













That gets me to 67235, but more importantly it explains the problem :D

– Gordon Gustafson
Sep 3 '09 at 23:34





That gets me to 67235, but more importantly it explains the problem :D

– Gordon Gustafson
Sep 3 '09 at 23:34













Rock'n'Roll ! :D

– Mehdi LAMRANI
Jul 11 '12 at 19:54





Rock'n'Roll ! :D

– Mehdi LAMRANI
Jul 11 '12 at 19:54













a bit confusing that BufferHeight and BufferWidth are Int32 but only accept Int16 values. :/

– cmxl
Apr 14 '15 at 13:16





a bit confusing that BufferHeight and BufferWidth are Int32 but only accept Int16 values. :/

– cmxl
Apr 14 '15 at 13:16













11














300 seems to be your default console buffer size. This is a Windows setting and it is not related to your application.



You can change the console buffer size by creating a shortcut to the executable. Then right click on the shortcut and select Properties. Go in the Options tab and change the buffer size.



Seem that I didn't check that feature in a long time, but it seem to be modifiable now. See Alfred Myers answer






share|improve this answer




















  • 3





    It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11















11














300 seems to be your default console buffer size. This is a Windows setting and it is not related to your application.



You can change the console buffer size by creating a shortcut to the executable. Then right click on the shortcut and select Properties. Go in the Options tab and change the buffer size.



Seem that I didn't check that feature in a long time, but it seem to be modifiable now. See Alfred Myers answer






share|improve this answer




















  • 3





    It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11













11












11








11







300 seems to be your default console buffer size. This is a Windows setting and it is not related to your application.



You can change the console buffer size by creating a shortcut to the executable. Then right click on the shortcut and select Properties. Go in the Options tab and change the buffer size.



Seem that I didn't check that feature in a long time, but it seem to be modifiable now. See Alfred Myers answer






share|improve this answer















300 seems to be your default console buffer size. This is a Windows setting and it is not related to your application.



You can change the console buffer size by creating a shortcut to the executable. Then right click on the shortcut and select Properties. Go in the Options tab and change the buffer size.



Seem that I didn't check that feature in a long time, but it seem to be modifiable now. See Alfred Myers answer







share|improve this answer














share|improve this answer



share|improve this answer








edited May 23 '17 at 10:27









Community

11




11










answered Sep 2 '09 at 21:16









Pierre-Alain VigeantPierre-Alain Vigeant

17k65397




17k65397







  • 3





    It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11












  • 3





    It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11







3




3





It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

– Alfred Myers
Sep 2 '09 at 22:11





It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

– Alfred Myers
Sep 2 '09 at 22:11











3














It is the console not your app.



As an alternative you can use Debug.WriteLine (System.Diagnostics) and use the Output window in Visual Studio. It has a much bigger buffer (just be sure to run a Debug build).






share|improve this answer























  • You can change the console's settings. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:13















3














It is the console not your app.



As an alternative you can use Debug.WriteLine (System.Diagnostics) and use the Output window in Visual Studio. It has a much bigger buffer (just be sure to run a Debug build).






share|improve this answer























  • You can change the console's settings. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:13













3












3








3







It is the console not your app.



As an alternative you can use Debug.WriteLine (System.Diagnostics) and use the Output window in Visual Studio. It has a much bigger buffer (just be sure to run a Debug build).






share|improve this answer













It is the console not your app.



As an alternative you can use Debug.WriteLine (System.Diagnostics) and use the Output window in Visual Studio. It has a much bigger buffer (just be sure to run a Debug build).







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 2 '09 at 21:36









Austin SalonenAustin Salonen

39.8k1393130




39.8k1393130












  • You can change the console's settings. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:13

















  • You can change the console's settings. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:13
















You can change the console's settings. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

– Alfred Myers
Sep 2 '09 at 22:13





You can change the console's settings. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

– Alfred Myers
Sep 2 '09 at 22:13











2














This has nothing to do with C#, but actually the output buffer in the command prompt is only 300 lines long by default. You can change that in the window settings, although maybe this is an opportunity to try implementing a "more" like feature, which breaks out of the loop every time a screenful of data is output. Then when you press a key, it outputs another screenful, etc.






share|improve this answer























  • It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:12















2














This has nothing to do with C#, but actually the output buffer in the command prompt is only 300 lines long by default. You can change that in the window settings, although maybe this is an opportunity to try implementing a "more" like feature, which breaks out of the loop every time a screenful of data is output. Then when you press a key, it outputs another screenful, etc.






share|improve this answer























  • It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:12













2












2








2







This has nothing to do with C#, but actually the output buffer in the command prompt is only 300 lines long by default. You can change that in the window settings, although maybe this is an opportunity to try implementing a "more" like feature, which breaks out of the loop every time a screenful of data is output. Then when you press a key, it outputs another screenful, etc.






share|improve this answer













This has nothing to do with C#, but actually the output buffer in the command prompt is only 300 lines long by default. You can change that in the window settings, although maybe this is an opportunity to try implementing a "more" like feature, which breaks out of the loop every time a screenful of data is output. Then when you press a key, it outputs another screenful, etc.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 2 '09 at 21:18









Carson MyersCarson Myers

20k30107158




20k30107158












  • It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:12

















  • It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:12
















It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

– Alfred Myers
Sep 2 '09 at 22:12





It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

– Alfred Myers
Sep 2 '09 at 22:12











2














You don't get to see anymore than that because the console does not buffer more than 300 rows by default. Use the settings dialog for the console to change this - I believe you can just start a command prompt and change them there, then run your program.



Alfred has already pointed out how your application can change the buffer height.






share|improve this answer




















  • 1





    Yes it is. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11











  • I stand corrected. I'll edit accordingly.

    – Michael Madsen
    Sep 3 '09 at 15:19















2














You don't get to see anymore than that because the console does not buffer more than 300 rows by default. Use the settings dialog for the console to change this - I believe you can just start a command prompt and change them there, then run your program.



Alfred has already pointed out how your application can change the buffer height.






share|improve this answer




















  • 1





    Yes it is. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11











  • I stand corrected. I'll edit accordingly.

    – Michael Madsen
    Sep 3 '09 at 15:19













2












2








2







You don't get to see anymore than that because the console does not buffer more than 300 rows by default. Use the settings dialog for the console to change this - I believe you can just start a command prompt and change them there, then run your program.



Alfred has already pointed out how your application can change the buffer height.






share|improve this answer















You don't get to see anymore than that because the console does not buffer more than 300 rows by default. Use the settings dialog for the console to change this - I believe you can just start a command prompt and change them there, then run your program.



Alfred has already pointed out how your application can change the buffer height.







share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 3 '09 at 15:19

























answered Sep 2 '09 at 21:17









Michael MadsenMichael Madsen

46.7k66075




46.7k66075







  • 1





    Yes it is. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11











  • I stand corrected. I'll edit accordingly.

    – Michael Madsen
    Sep 3 '09 at 15:19












  • 1





    Yes it is. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

    – Alfred Myers
    Sep 2 '09 at 22:11











  • I stand corrected. I'll edit accordingly.

    – Michael Madsen
    Sep 3 '09 at 15:19







1




1





Yes it is. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

– Alfred Myers
Sep 2 '09 at 22:11





Yes it is. It can be changed through Console.BufferHeight up to Int16.MaxValue - 1

– Alfred Myers
Sep 2 '09 at 22:11













I stand corrected. I'll edit accordingly.

– Michael Madsen
Sep 3 '09 at 15:19





I stand corrected. I'll edit accordingly.

– Michael Madsen
Sep 3 '09 at 15:19

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f1370158%2fconsole-bufferheight-i-cant-see-scroll-to-see-all-the-console-output-with-con%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

Museum of Modern and Contemporary Art of Trento and Rovereto