.NET/C# Local AppData Handling
Writing to the application directory (Program Files) can be a problem, so here's how you define an AppData path.
C#
private static string appdatapath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
private static string AppDataFolder = string.Format(@"{0}\{1}\{2}", appdatapath, "thronic.com", "ProgramName");
private static string LogFile = string.Format(@"{0}\{1}", AppDataFolder, "SomeLogFileOrOther.txt");
Creating the directory
if (!Directory.Exists(AppDataFolder))
Directory.CreateDirectory(AppDataFolder);
It will create recursively (non-existing parent folders as well).