I obtained a byte array using File.ReadAllBytes(); and I converted it into a string (s).
I converted my byte array to simple string using this code:
string name;
string s;
byte[] bytes;
bytes = File.ReadAllBytes(name);
foreach (byte b in bytes)
{
s = s + b + ".";
}
Now s is something like "255.0.0.12.100.4.24.40.0.0.200". Now I want to convert this string into a file. Using s.Split('.') I can get all the individual numbers. But how can I copy all the bytes into a file? (reconstruct the original file)
File.ReadAllBytesdoesn't return astring[]- it returns abyte[]. Please give a minimal reproducible example - at the moment your question doesn't make much sense. (It would without the last sentence - at which point I'd just suggestarray.Select(x => byte.Parse(x)).ToArray()...)