|
-
Oct 11th, 2007, 11:58 AM
#9
Re: [2005] Validating Path
I'm sorry, but you're telling me that because it's difficult to program this, then I should ask to change the specs?
No, we are telling you to change the specs because there are better ways, they easily exist and you won't or rather the ridiculous specs you have been given won't allow them to be used.
I really thought Microsoft would anticipate this and come up with something to do it.
They have - it's the FolderBrowserDialog
You are artificially creating a scenario that shouldn't be really used because of the massive risk or error that it generates. If so, I doubt they would just check for ":" and simply catch any error that could arise.
I just figured if I'm going to code in .NET, I should take advantage of all it's functionality.
Same as the point above - use the FolderBrowserDialog
If you want to check each character in the textbox field then you could do this but this still wouldn't be correct, I can see other errors that could happen...
Code:
Dim myChar() As Char = CType(Me.TextBox1.Text, Char())
If myChar.Length > 2 Then
For i As Integer = 2 To myChar.Length - 1
If myChar(i) = ":" Then
MessageBox.Show("Stop putting illegal characters in")
Exit Sub
End If
Next
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|