W
wizofaus
Hi,
If I write the following unmanaged C program:
main()
{
char buffer[1000];
gets(buffer);
}
I can type in pretty any length string at all (buffer overflow aside).
But if I try in managed C++ (or C#),
Console::ReadLine();
I can only type in 254 characters, allowing I imagine 2 for the
necessary CRLF.
I've even tried creating a FileStream on the handle from
GetStdHandle(STD_INPUT_HANDLE), but I get the same problem (which
really surprises me).
The only way I can read more from .NET is use ReadConsole directly.
Any clues why, and is there a way to change this behaviour? I need to
be able to enter much longer lines than 256 characters into my console
app.
Thanks
If I write the following unmanaged C program:
main()
{
char buffer[1000];
gets(buffer);
}
I can type in pretty any length string at all (buffer overflow aside).
But if I try in managed C++ (or C#),
Console::ReadLine();
I can only type in 254 characters, allowing I imagine 2 for the
necessary CRLF.
I've even tried creating a FileStream on the handle from
GetStdHandle(STD_INPUT_HANDLE), but I get the same problem (which
really surprises me).
The only way I can read more from .NET is use ReadConsole directly.
Any clues why, and is there a way to change this behaviour? I need to
be able to enter much longer lines than 256 characters into my console
app.
Thanks