ADO DOT NET
Centurion
- Joined
- Dec 20, 2006
- Messages
- 160
Hi,
I want to convert this function to VB.NET:
Everything is alright, I just cannot find the new Asc() method in .NET.
Each old method has a .NET version, for example InStr instead of Mid$ but where is new method for ASC()?
Thanks.
I want to convert this function to VB.NET:
Visual Basic:
Private Function FilterFileName(ByVal FileName As String) As String
FilterFileName = Empty
Dim MyLoop As Integer
For MyLoop = 1 To Len(FileName)
If Asc(Mid$(FileName, MyLoop, 1)) >= 97 And Asc(Mid$(FileName, MyLoop, 1)) <= 122 Or _
Asc(Mid$(FileName, MyLoop, 1)) >= 65 And Asc(Mid$(FileName, MyLoop, 1)) <= 90 Or _
Asc(Mid$(FileName, MyLoop, 1)) >= 48 And Asc(Mid$(FileName, MyLoop, 1)) <= 57 Or _
Asc(Mid$(FileName, MyLoop, 1)) = 32 Or _
Asc(Mid$(FileName, MyLoop, 1)) = 45 Or _
Asc(Mid$(FileName, MyLoop, 1)) = 95 Then
FilterFileName = FilterFileName & Mid$(FileName, MyLoop, 1)
End If
Next
End Function
Each old method has a .NET version, for example InStr instead of Mid$ but where is new method for ASC()?
Thanks.