@AMER SAID , based on my test, I reproduced your problem. We need to combine the path by using Path.Combine Method to combine directory and files.
You could modify into the following code.
string a = DateTime.Now.ToString("yyyy-MM-dd") + ".png";
string newpath=Path.Combine(programDirectory, a);
pictureBox1.Image.Save(newpath);
var files = new string[] { newpath };
Result:
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.