add: Autoinsert process name, .exe filter

This commit is contained in:
slothdpal
2024-05-16 16:22:27 +03:00
parent 5c48e9803f
commit a7fd009b21
4 changed files with 105 additions and 98 deletions

View File

@@ -156,6 +156,7 @@ namespace Process_Auto_Relaunch
private void buttonSetProgramStart_Click(object sender, EventArgs e)
{
OpenFileDialog openFile = new OpenFileDialog();
openFile.Filter = "Èñïîëíÿåìûå ôàéëû (*.exe)|*.exe";
openFile.Title = "Óêàæèòå ïðîãðàììó çàïóñêà";
if (openFile.ShowDialog() == DialogResult.Cancel)
@@ -163,7 +164,9 @@ namespace Process_Auto_Relaunch
return;
}
//labelProgramStartPath.Text = openFile.FileName;
int lastSlash = openFile.FileName.LastIndexOf("\\");
textBoxProcessName.Text = openFile.FileName.Substring(lastSlash+1);
textBoxProcessName.Text = textBoxProcessName.Text.Remove(textBoxProcessName.Text.Length-4);
Settings.Default.startProgramPath = openFile.FileName;
Settings.Default.Save();