Reputation: 1187
I have a piece of code which reads from an excel template which goes like this,
if (File.Exists(@"C:\WebcamExcel\Webcam1.xlsx"))
{
//Do My stuff
}
Currently I have pasted it in the given path, however how can I add this as part of my Windows Form application installation?
Also if the user installed in a different disk rather than C drive, how better can I write the above code to check it from installed location?
Upvotes: 0
Views: 581
Reputation: 8992
if (File.Exists(Application.StartupPath + @"\Webcam1.xlsx"))
{
//Do My stuff
}
Upvotes: 1