Results 1 to 33 of 33

Thread: [RESOLVED] [2005] Validating Path

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member rjbudz's Avatar
    Join Date
    Jul 2005
    Location
    San Diego
    Posts
    262

    Re: [2005] Validating Path

    techgnome, don't get me wrong. I very much appreciate everyone's input, and the diligence shown it trying to resolve the issue!

    The post you quoted is the actual program as laid out by my predecessor. As such, the user can type into the textbox anything they want (though a suggested folder name is presented.

  2. #2
    Fanatic Member bgmacaw's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, GA USA
    Posts
    524

    Re: [2005] Validating Path

    OK, try this.

    Code:
        Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
            Try
                Dim PathPattern As String = "^(([a-zA-Z]:|\\)\\)?(((\.)|(\.\.)|([^\\/:\*\?""\|<>\. ](([^\\/:\*\?""\|<>\. ])|([^\\/:\*\?""\|<>]*[^\\/:\*\?""\|<>\. ]))?))\\)*[^\\/:\*\?""\|<>\. ](([^\\/:\*\?""\|<>\. ])|([^\\/:\*\?""\|<>]*[^\\/:\*\?""\|<>\. ]))?$"
                If System.Text.RegularExpressions.Regex.IsMatch(TextBox1.Text, PathPattern) Then
                    Debug.Print("True")
                Else
                    Debug.Print("False")
                End If
            Catch ex As Exception
                Debug.Print("Exception")
            End Try
        End Sub

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