Server Error in '/' Application.

Could not find a part of the path 'C:\HostingSpaces\Mahesh\admission.kcpgclko.in\wwwroot\KCPG\WebGallery\2021 - Rangotsav'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\HostingSpaces\Mahesh\admission.kcpgclko.in\wwwroot\KCPG\WebGallery\2021 - Rangotsav'.

Source Error:


Line 20:             string foldername = Admission_Helper.Decrypt(Request.QueryString["gid"].ToString());
Line 21:             lblFolderName.Text = foldername;			
Line 22:             string[] filenames = Directory.GetFiles(LocalPath + foldername + "", "*", SearchOption.AllDirectories);
Line 23:             int i = 0;
Line 24:             foreach (string s in filenames)

Source File: C:\Inetpub\vhosts\kcpgclko.in\httpdocs\ViewGallery.aspx.cs    Line: 22

Stack Trace:


[DirectoryNotFoundException: Could not find a part of the path 'C:\HostingSpaces\Mahesh\admission.kcpgclko.in\wwwroot\KCPG\WebGallery\2021 - Rangotsav'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +281
   System.IO.FileSystemEnumerableIterator`1.CommonInit() +421
   System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) +515
   System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption) +120
   ViewGallery.Page_Load(Object sender, EventArgs e) in C:\Inetpub\vhosts\kcpgclko.in\httpdocs\ViewGallery.aspx.cs:22
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4110.0