power_settings_new

how to check if file exists in c# .net?

by
asked
0 votes
64 views
I am creating program in c# .net with windowsForm. Can I get a program to check if file exists? I would like to display alert if file is removed.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

answered by (171 points)
selected by
0 votes
 
Best answer
You can use

 

System.io.File.Exists("file\\path");
add
...