I have loaded the files to combo box…
private void Form1_Load(object sender, EventArgs e)
{
Directory.CreateDirectory(@"X:\BookStoreProject\WindowsFormsApplication2\Resources\PDF_Books");
DirectoryInfo dir = new DirectoryInfo(@"X:\BookStoreProject\WindowsFormsApplication2\Resources\PDF_Books");
FileInfo[] files = dir.GetFiles("*.pdf");
foreach (FileInfo file in files)
{
cboPDF.Items.Add(file);
}
I now want to select the pdf from the combo box and load the pdf. But for some reason everything I try is not working. I can run a command (note this a different project)…
System.Diagnostics.Process.Start(@"C:\Users\Shane\Documents\Visual Studio 2010\Projects\Beginning Hibernate, 2006.pdf");
That is giving a direct string path, but my problem is maybe trying to recreate a path like this is the wrong direction?
You need to specify installation path of your PDF as your first parameter and name of pdf file as second.
EDIT from Shane’s Comments