(C#) 努力将 Console.App 代码迁移到 WIndows 表单

(C#) Struggle to migrate Console.App code to WIndows Form

我需要将此控制台代码转换为 WinForms 代码。 此代码用于接收数据的 HexDump 格式。我试着转换 Console.WriteLine(Hex.Dump(example))textBox4.Text (Hex.Dump(example)) 不知道对不对,还在纠结Console.OutputEncoding

    Console.OutputEncoding = Encoding.GetEncoding(1252);
    byte[] example = Enumerable.Range(0, 256).Select(x => (byte)x).ToArray();
    Console.WriteLine(Hex.Dump(example));

它不是工作代码,不要使用它