Dir() returns a string an SortDirection.Ascending is of type SortDirection. As they are of different types you can't ask if they are equal, it's like asking if an apple equals an orange.
The code makes no sense anyway, how can the name of a folder equal a sort order? If you are trying to see if the direction is literally called SortDirection then do
if (FileSystem.Dir() == SortDirection.Ascending.ToString())