Imports System.IO
public class Test
public Shared Sub Main
Console.WriteLine("Current directory is " & Directory.GetCurrentDirectory & ".")
Try
Directory.SetCurrentDirectory("..\..\..\..\..\Temp")
Console.WriteLine("Switched current folder to " & _
Directory.GetCurrentDirectory & ".")
Catch exc As FileNotFoundException
Console.WriteLine("Invalid folder specified, currrent directory is " & _
vbCrLf & Directory.GetCurrentDirectory & ".")
Catch exc As Exception
Console.WriteLine("Can't access the specified folder.")
End Try
End Sub
End class
|