Hello all,
At this point most people will be thinking "Ah ill post this..:"
byte[] dataB= System.Text.Encoding.ASCII.GetBytes(data);
However.. the problem I have is i need the exact value of the bytes with no encoding just the pure value for each byte. For example if the value of the string is (0xFF32) i want it to convert it too {255,50}. he reason for this is I have a file format I am attempting to read which stores int's as bytes saves them and then reads them when the program opens.
This is what I have so far:
...
dialog.InitialDirectory =
Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) +
"/Test";
dialog.Title="Open File";
if (dialog.ShowDialog(this) == DialogResult.OK)
{
StreamReader reader = new StreamReader(dialog.FileName);
string data = reader.ReadToEnd();
reader.Close();
byte[] fileC = System.Text.Encoding.ASCII.GetBytes(data);
File_Read(dialog.FileName,fileC);
}
...
So when I try and read the file it converts the file convents of say 0xFF into 0x3F because 0xFF is greater then 127 and 0x3F is a ?.
Sorry if i seem a bit confusing :)
Thanks, Michael