An alternative solution could be this.
using System.IO;
namespace vc
{
public partial class Form1 : Form
{
public string path_program { get; private set; }
public string path_program_log { get; private set; }
public string path_log { get; private set; }
private void Form1_Load(object sender, EventArgs e)
{
path_program = create_folder("log");
path_program_log = create_folder("image");
}
private string create_folder(string name_folder)
{
string n = Path.Combine(
Path.GetDirectoryName(Application.ExecutablePath),
name_folder));
if (!Directory.Exists(n))
{
Directory.CreateDirectory(n);
}
return n;
}
}
}