1

I'm trying to write a console application and I want to paste quite a significant amount of data. However, I'm currently limited to the 254 character limit. Is there a way to increase this limit with VB.Net?

The only solutions that I have came across are for c# or forms, but I'm writing in console only.

Racil Hilan
  • 24,690
  • 13
  • 50
  • 55

1 Answers1

1

There are many similar questions and answers for C# like this one, but for some reason nothing for VB. However, it pretty easy to convert the code from C# to VB. Here is a conversion of the best answer I found:

Console.SetIn(New StreamReader(Console.OpenStandardInput(8192)))
Dim line As String = Console.ReadLine()

The Console.SetIn() allows you to change the TextReader for the Console. The value 8192 is the buffer size. Some answers suggest setting it to 1024 (1KB), but perhaps 8192 (8KB) works better for this purpose.

Racil Hilan
  • 24,690
  • 13
  • 50
  • 55