I don't know why I can't get this to work, I have found lots of answers on google but none of them seem to work for me.
My program requires a file on disk called "wordlist.txt" at runtime, in the same directory as the executable. So I have in my constructor code to check whether it exists, and if not to create it by copping it from the embedded resource
public Form1()
{
InitializeComponent();
if (!File.Exists("wordlist.txt"))
{
byte[] ba = File.ReadAllBytes(Properties.Resources.wordlist);
File.WriteAllBytes("wordlist.txt", ba);
}
}
It tells me I have illegal characters in my path though.