Follow by Email

Wednesday, 24 December 2014

How to Check if folder exists, if not create it in C#

                string realPath;
                realPath = Server.MapPath("~/ReportHtmlFiles/" + TestFolder + "/");
                // Check if folder exists, if not create it
                if (!Directory.Exists(realPath))
                {
                    Directory.CreateDirectory(realPath);
                }

0 comments:

Post a Comment


                                                            

 
Design by Abhinav Ranjan Sinha