MessageBox - File exists

  • Thread starter Thread starter W. Danner
  • Start date Start date
W

W. Danner

Hello,
I will need to download an ebook about C#, but am I allowed to ask a
question right away?
This code throws a compiler error:

System.Windows.Forms.MessageBox.Show (System.IO.File.Exists("myfile.txt"));

Can somebody please tell me how it's done correctly?
I would like to show a messagebox that tells me if this file exists. I
do not want to write the full path, but I would like to know if my
application finds the file right away...

Thank you
Will
 
Hi Will,

Try this :

System.Windows.Forms.MessageBox.Show
(System.IO.File.Exists("myfile.txt").ToString());

HTH,

Michel
 
Back
Top