Results 1 to 2 of 2

Thread: ? Directory Validation Bug???

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Question ? Directory Validation Bug???

    Esteemed Forum Participants and Lurkers:

    .NET Framework 1.1 - VB.NET 2003

    I'm trying to validate a directory, and I've come across a weird anomaly ...

    I have a directory: C:\Table
    The following
    Code:
    Dim attr As FileAttribute
    Try
        attr = GetAttr("C:\\\\\Table\\\")
        If (attr And FileAttribute.Directory) = FileAttribute.Directory Then
            MsgBox("VALID")
        End If
    Catch
        MsgBox("NOT valid")
    End Try
    Returns "VALID" - I would expect it to catch an exception for the invalid Path specification???

    Thank you for any comments, suggestions, or assistance.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  2. #2
    Junior Member
    Join Date
    Jul 2004
    Location
    Port Huron, Michigan
    Posts
    20
    You can use System.IO.Path.GetFullPath("C:\\\\\Table\\\") to convert it to the absolute path. I can only guess that its a legitimate path because each "\" represents a movement in the path direction and without a name or ".." it sees it as staying still in the location its at instead of moving ahead or back, so:
    C:\\\\\\\ = C:\
    Table\\\ = Table\

    Which would make it legit.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width