I’m using this code to find the name of an excel file inside the application directory. But if the file is not found i want to give an error message. How can i do that using c#? Below is the code i used to search the file.
string linksfile;
string [] excelfile = Directory.GetFiles(Application.StartupPath + @"\", "*.xlsx");
linksfile = excelfile[0];
MessageBox.Show(linksfile);
1 Answer