I am trying to follow this thread:
How to read embedded resource text file
However I am not able to make it work.
Goal: From a txt file that it is embed on the project which has a list of names. Read all the entries, store them on an array list of strings.
Current code based on the linked thread:
var assembly = Assembly.GetExecutingAssembly();
using (Stream stream = assembly.GetManifestResourceStream(TownGame.Properties.Resources.m_names))
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
}
Which is the best way to fill out:
public string[] names_list = new string[20]; //list of names
With the content of the embed m_names.txt file?
Changed the original code for this: This is in a debugging, The streamer is NULL still the file has content as shown with the mouse over the n_names.txt