I was wondering if anyone can help me on this one, I've search the whole internet and I can't seem to find any solution, I want to read byte from a txt file, at first i use string array to get the files that end with .txt, follow by converting string array to string and use the string to read all bytes and place it in byte array. But when I run the program it come out an exception stating System.NotSupportedException. Can anyone help?
String[] fileArray = Directory.GetFiles(@"C:\Users\Desktop\feature", "*.txt");
String file = ConvertStringArrayToString(fileArray);
Byte[] pFeatureLib = File.ReadAllBytes(file); // error occur here
public String ConvertStringArrayToString(String[] array)
{
// Concatenate all the elements into a StringBuilder.
StringBuilder builder = new StringBuilder();
foreach (string value in array)
{
builder.Append(value);
builder.Append('.');
}
return builder.ToString();
}
File.ReadAllTextorFile.ReadAllLines.