I want to write a long list of binary number into a binary file from a list. The list are now all Hexadecimal number. My code below is not giving what i want like case 1, instead it output case 2. Please help.
Case 1: What i need is a binary file - 1A0F83.....
Case 2: but not - 314130463833.....
List<string> list = new List<string>(new string[]{"1A", "0F", "83" });
using (var s = File.Open("test.bin", FileMode.Create))
{
var tw = new BinaryWriter(s);
foreach (string i in list) // Loop through all strings
{
tw.Write(i);
}
}