From 9cc06488361e47da3dbc2501ffffe614c618d19a Mon Sep 17 00:00:00 2001 From: Nik Date: Sun, 25 Sep 2022 21:54:59 -0500 Subject: [PATCH] Update Form1.css Fixing issues with trimming too much from the beginning. --- IsoMaker/IsoMaker/Form1.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/IsoMaker/IsoMaker/Form1.cs b/IsoMaker/IsoMaker/Form1.cs index e0296a3..2a6c83d 100644 --- a/IsoMaker/IsoMaker/Form1.cs +++ b/IsoMaker/IsoMaker/Form1.cs @@ -46,7 +46,13 @@ private Dictionary getFileList(DirectoryInfo folder, DirectoryIn foreach (FileInfo file in folder.GetFiles()) { string fileFullPath = file.FullName; - string fileOnIso = fileFullPath.TrimStart(home.FullName.ToCharArray()); + + // The code below might chop off too much of the string. I had this issue. + // string fileOnIso = fileFullPath.TrimStart(home.FullName.ToCharArray()); + + // This code simply delimits the string by the root directory path with a backslash. This works better. + string fileOnIso = fileFullPath.Split(home.FullName + '\\')[1]; + output.Add(fileOnIso, file.FullName); }