c# - Excel file path doesn't work -


i have (and works):

if (sport == "athletics")             {                 excel_init("c:/users/dries canfyn/desktop/score/scoretablemenathletics.xlsx");             } 

but want include excel file in project.

the excel file in folder called io, in same folder class 'if' in. how can reach excel file? path should use?

determine workingdirectory , use relative path there.
workingdirectory .exe resides, depends on how started process. can use relative path like

if (sport == "athletics")      {          excel_init("io/scoretablemenathletics.xlsx");      } 

i don't know happens inside excel_init, consider msdn, processstartinfo.workingdirectory property:

when useshellexecute property false, gets or sets working directory process started. when useshellexecute true, gets or sets directory contains process started.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -