Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem with SQL-Server Date Query Pin
Dino Mulahusic8-Apr-09 4:12
professionalDino Mulahusic8-Apr-09 4:12 
GeneralRe: Problem with SQL-Server Date Query Pin
der.flori8-Apr-09 4:21
der.flori8-Apr-09 4:21 
GeneralRe: Problem with SQL-Server Date Query Pin
Searril8-Apr-09 4:29
Searril8-Apr-09 4:29 
GeneralRe: Problem with SQL-Server Date Query Pin
Dino Mulahusic8-Apr-09 4:30
professionalDino Mulahusic8-Apr-09 4:30 
GeneralRe: Problem with SQL-Server Date Query Pin
der.flori8-Apr-09 4:41
der.flori8-Apr-09 4:41 
GeneralRe: Problem with SQL-Server Date Query Pin
Dave Kreskowiak8-Apr-09 4:58
mveDave Kreskowiak8-Apr-09 4:58 
GeneralRe: Problem with SQL-Server Date Query Pin
PIEBALDconsult8-Apr-09 5:17
mvePIEBALDconsult8-Apr-09 5:17 
QuestionVerification class Pin
Wheels0128-Apr-09 3:33
Wheels0128-Apr-09 3:33 
Good morning.

I am trying to create a verification class to test for special characters (not including *) when a user types in a text box. I will be running this off of the textbox keydown (or change) method.

So far I have the following:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsFormsApplication1
{
class Verification
{

public bool Verify(String strChar)
{
bool InvalidChar = false;
int NumValue = 0;
char[] charArray = strChar.ToCharArray();

foreach (char c in charArray)
{
NumValue += (Convert.ToInt16(c) + 128);

if (NumValue == 42) //ASCII * character
{
InvalidChar = true;
break;
}
else if (NumValue < 65 && NumValue > 90) //ASCII A-Z characters
{

InvalidChar = true;
break;
}
}

return InvalidChar;
}
}
}

I was advised to stay away from Substrings. What is the best method to accomplish this verficiation?

Thank you,

WHEELS
AnswerRe: Verification class Pin
Jimmanuel8-Apr-09 3:41
Jimmanuel8-Apr-09 3:41 
GeneralRe: Verification class Pin
Wheels0128-Apr-09 3:44
Wheels0128-Apr-09 3:44 
GeneralRe: Verification class Pin
Jimmanuel8-Apr-09 3:52
Jimmanuel8-Apr-09 3:52 
Questionprinting a dataTable or data from datagridview Pin
laziale8-Apr-09 2:56
laziale8-Apr-09 2:56 
AnswerRe: printing a dataTable or data from datagridview Pin
musefan8-Apr-09 3:16
musefan8-Apr-09 3:16 
AnswerRe: printing a dataTable or data from datagridview Pin
MNantu8-Apr-09 4:25
MNantu8-Apr-09 4:25 
QuestionString contained within string Pin
kanchoette8-Apr-09 2:56
kanchoette8-Apr-09 2:56 
Answercontained Pin
Luc Pattyn8-Apr-09 3:15
sitebuilderLuc Pattyn8-Apr-09 3:15 
GeneralRe: contained Pin
musefan8-Apr-09 3:19
musefan8-Apr-09 3:19 
AnswerRe: String contained within string Pin
ricmil428-Apr-09 3:16
ricmil428-Apr-09 3:16 
QuestionDLL missing? Pin
tom5720078-Apr-09 2:54
tom5720078-Apr-09 2:54 
AnswerRe: DLL missing? Pin
tom5720078-Apr-09 2:56
tom5720078-Apr-09 2:56 
AnswerRe: DLL missing? Pin
EliottA8-Apr-09 2:57
EliottA8-Apr-09 2:57 
GeneralRe: DLL missing? Pin
tom5720078-Apr-09 2:59
tom5720078-Apr-09 2:59 
GeneralRe: DLL missing? Pin
EliottA8-Apr-09 3:01
EliottA8-Apr-09 3:01 
GeneralRe: DLL missing? Pin
EliottA8-Apr-09 3:02
EliottA8-Apr-09 3:02 
GeneralRe: DLL missing? Pin
tom5720078-Apr-09 4:02
tom5720078-Apr-09 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.