Can you just not.
It doesn't work whatsoever, worst bit of code I've ever seen....
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace ChaoSQL { class Program { static void Main(string[] args) { } } }
Console.Readline()
Encoding.Default.GetBytes(Console.ReadLine())
bytes = Encoding.Default.GetBytes(Console.ReadLine());
string readLine = Console.ReadLine(); if (Encoding.Default.GetBytes(readLine).Length <= 255) { bytes = Encoding.Default.GetBytes(readLine); }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace BTAProtection { class Program { static void Main(string[] args) { // Not Safe > bytes = Encoding.Default.GetBytes(Console.ReadLine()); string readLine = Console.ReadLine(); if (Encoding.Default.GetBytes(readLine).Length <= 255) { bytes = Encoding.Default.GetBytes(readLine); } } } }
byte[] bytes = new byte[255]; //allocate a block of memory that is never used
bytes = Encoding.Default.GetBytes(Console.ReadLine()); //point to a new block of memory (appropriately sized) allocated by GetBytes
The variable bytes just points to a new block of memory of the appropriate size allocated by Encoding.Default.GetBytes.