I'm sorry to result to a terribly simple question for you, but I am in need of some help. I'm using Visual Basic 2005 Express Edition and trying to create the simplest program possible. Right now all I need to be able to do is read an input (no problem) and then check if a directory exists (just won't work!) Here's what I'm working with:
This is my most recent attempt, after which I finally decided I need expert assistance. I've been around and around trying different possibilities with absolutely no success. Most of my experience is with VBScript/ASP and older VB, but I haven't had any luck in VBEE with CreateObject("Scripting.FileSystemObject") either.
In general I'll input "TEST" or "TEST\" at the prompt, a directory that definitely exists, but my message comes back FAILED every time. Any help would be greatly appreciated.
Thanks,
Eric
Code:
Imports System.IO
Module Module1
Sub Main()
Dim strFilePath As String
Dim strPath As String
Dim i As Integer
Console.WriteLine()
Console.Write("Enter path > c:\")
strFilePath = Console.ReadLine
strPath = "c:\" & strFilePath
Console.WriteLine()
If Directory.Exists(strPath) Then Console.WriteLine("OK") Else Console.WriteLine("FAILED")
End Sub
End Module
In general I'll input "TEST" or "TEST\" at the prompt, a directory that definitely exists, but my message comes back FAILED every time. Any help would be greatly appreciated.
Thanks,
Eric