Click here to Skip to main content
15,888,254 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i need to convert this console code to WInForms code. This code for HexDump format of recevieng data. I tried to convert "Console.WriteLine(Hex.Dump(example))" to "textBox4.Text (Hex.Dump(example))" Dont know is it correct or not, and still struggle with converting "console. OUtputEncoding"

What I have tried:

Console.OutputEncoding = Encoding.GetEncoding(1252);
 byte[] example = Enumerable.Range(0, 256).Select(x => (byte)x).ToArray();
 Console.WriteLine(Hex.Dump(example));
Posted
Updated 9-Feb-17 17:44pm

1 solution

Ummm... All you're doing is writing a string to the console. That's a function call to WriteLine and you pass in what you want to write.

To do the same thing in a TextBox, that's setting the Text property of the TextBox.
C#
textBox4.Text = Hex.Dump(example);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900