Posts
Você pode pegar o caracter ASC através do método keyPress
Private Sub text_box_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles text_box_KeyPress
Dim KeyAscii As Short = CShort(Asc(e.KeyChar))
If KeyAscii >= 65 And KeyAscii <= 90 Then
MsgBox("Maiusculo")
ElseIf KeyAscii >= 97 And KeyAscii <= 122 Then
MsgBox("Min£sculo")
ElseIf KeyAscii >= 48 And KeyAscii <= 57 Then
MsgBox("N£mero")
Else
MsgBox("Caracteres Especiais")
End If
End sub
Logo após você terá que ver entre a tabela ASCII
Você pode pegar o caracter ASC através do método keyPress
Private Sub text_box_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles text_box_KeyPress
Dim KeyAscii As Short = CShort(Asc(e.KeyChar))
If KeyAscii >= 65 And KeyAscii <= 90 Then
MsgBox("Maiusculo")
ElseIf KeyAscii >= 97 And KeyAscii <= 122 Then
MsgBox("Min£sculo")
ElseIf KeyAscii >= 48 And KeyAscii <= 57 Then
MsgBox("N£mero")
Else
MsgBox("Caracteres Especiais")
End If
End sub
Logo após você terá que ver entre a tabela ASCII
Você pode pegar o caracter ASC através do método keyPress
Private Sub text_box_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles text_box_KeyPress
Dim KeyAscii As Short = CShort(Asc(e.KeyChar))
If KeyAscii >= 65 And KeyAscii <= 90 Then
MsgBox("Maiusculo")
ElseIf KeyAscii >= 97 And KeyAscii <= 122 Then
MsgBox("Min£sculo")
ElseIf KeyAscii >= 48 And KeyAscii <= 57 Then
MsgBox("N£mero")
Else
MsgBox("Caracteres Especiais")
End If
End sub
Logo após você terá que ver entre a tabela ASCII
Caso seja somente identificar qual o formato do caracter vc pode utilizar a classe Char do framwork que ela possui todos testes, segue um exemplo usando c# em um projeto Web:
string strTeste = "TeSt@nD0!◄";
char[] charArray = strTeste.ToCharArray();
StringBuilder resultado = new StringBuilder();
foreach (char c in charArray)
{
if (Char.IsUpper(c))
{
resultado.Append(c + " - IsUpper <br/>");
}
else if (Char.IsLower(c))
{
resultado.Append(c + " - IsLower <br/>");
}
else if (Char.IsSymbol(c))
{
resultado.Append(c + " - IsSymbol <br/>");
}
else if (Char.IsNumber(c))
{
resultado.Append(c + " - IsNumber <br/>");
}
else if (Char.IsPunctuation(c))
{
resultado.Append(c + " - IsPunctuation <br/>");
}
}
Response.Write(resultado.ToString());
16/02/2010
Eleuterio Gonzalez
pode montar um select case e verificar via keypress