Server Error in '/' Application.

Illegal characters in path.

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.ArgumentException: Illegal characters in path.

Source Error:


Line 534:        int imgHeight;
Line 535:        int imgWidth;
Line 536:        foreach (string s in Directory.GetFiles(PicsPath, "*.png"))
Line 537:        {
Line 538:            System.Drawing.Image currentImage = System.Drawing.Image.FromFile(s);

Source File: e:\hostingspaces\ronens\myoffice24.net\wwwroot\App_Code\DAL.cs    Line: 536

Stack Trace:


[ArgumentException: Illegal characters in path.]
   System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths) +12950956
   System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths) +110
   System.IO.Path.GetFullPathInternal(String path) +119
   System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) +160
   System.IO.Directory.GetFiles(String path, String searchPattern) +82
   DAL.DefaultLoad(String PicsPath, String directoryPath) in e:\hostingspaces\ronens\myoffice24.net\wwwroot\App_Code\DAL.cs:536
   guides_linux_kickstart.Page_Load(Object sender, EventArgs e) in e:\hostingspaces\ronens\myoffice24.net\wwwroot\post.aspx.cs:27
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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