Contact Me

Nirav Prabtani

Mobile : +91 738 308 2188

Email : niravjprabtani@gmail.com

Nirav Prabtani

Saturday 10 May 2014

How to check file is exists using c#


you can check it very simple way by using that code


 protected void Page_Load(object sender, EventArgs e)

        {
            string Filestatus = FileStatusFunc("MyPath");
        }

        public string FileStatusFunc(string FilePath)
        {
            if (System.IO.File.Exists(FilePath))
            {
                return "Exists";
            }
            else
            {
                return "is not Exists";
            }
        }

No comments :

Post a Comment