From 91604723d5c0696e82d729b486abd07aaa9fd24a Mon Sep 17 00:00:00 2001 From: pfg github Date: Mon, 16 Mar 2015 08:43:36 -0700 Subject: why use for loops when you can just import system.io also fixed some paths, stopped for the skinning problem --- ShiftOS/File Skimmer.vb | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'ShiftOS/File Skimmer.vb') diff --git a/ShiftOS/File Skimmer.vb b/ShiftOS/File Skimmer.vb index 9d242cc..0cc9085 100644 --- a/ShiftOS/File Skimmer.vb +++ b/ShiftOS/File Skimmer.vb @@ -589,16 +589,28 @@ Public Class File_Skimmer infobox.textinfo = "Unable to move into a higher directory due to error reading the requested folder on the drive." & Environment.NewLine & Environment.NewLine & "You can only enter directories formatted in the ShiftOS file system (ShiftFS)" infobox.Show() Else - Dim endloop As Boolean = False - lbllocation.Text = lbllocation.Text.Substring(0, lbllocation.Text.Length - 1) - - While endloop = False - If lbllocation.Text.Substring(lbllocation.Text.Length - 1) = "/" Then - endloop = True - Else - lbllocation.Text = lbllocation.Text.Substring(0, lbllocation.Text.Length - 1) - End If - End While + Dim directoryInfo As System.IO.DirectoryInfo + directoryInfo = System.IO.Directory.GetParent(lbllocation.Text) + If (directoryInfo.FullName = "C:\") Then Dim errerror As String = "an error" Else lbllocation.Text = directoryInfo.FullName + + 'Dim endloop As Boolean = False + 'lbllocation.Text = lbllocation.Text.Substring(0, lbllocation.Text.Length - 1) + + 'While endloop = False + ' Try + ' If lbllocation.Text.Substring(lbllocation.Text.Length - 1) = "/" Then + ' endloop = True + ' Else + ' lbllocation.Text = lbllocation.Text.Substring(0, lbllocation.Text.Length - 1) + ' End If + ' Catch + ' infobox.title = "File Skimmer - Error!" + ' infobox.textinfo = "Unable to move into a higher directory due to error reading the requested folder on the drive." & Environment.NewLine & Environment.NewLine & "An error occured going up" + ' infobox.Show() + ' End Try + 'End While + + showcontents() End If Else -- cgit v1.2.3