MessageBox - File exists

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • W. Danner

    #1

    MessageBox - File exists

    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.MessageBo x.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
  • fd123456@hotmail.com

    #2
    Re: MessageBox - File exists

    Hi Will,

    Try this :

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

    HTH,

    Michel

    On 4 août, 13:29, "W. Danner" <w.dan...@hotma il.comwrote:
    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.MessageBo x.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

    Comment

    • W. Danner

      #3
      Re: MessageBox - File exists

      Thank you very much!!
      Will

      Comment

      Working...