C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







Validating TextBoxes in C#


Posted Date: 24 Jan 2004    Resource Type: Articles    Category: Web Applications

Posted By: Sailash J Prakash       Member Level: Gold
Rating:     Points: 10



The resource has not been reviewed by Editors yet. Readers are adviced to use their best judgement before accessing this resource.
This resource will be reviewed shortly.
If you think this resource contain inappropriate content, please report to webmaster.


The IsNumeric Function Checks for numeric value.


private void txtPortNo_KeyPress(object sender,System.Windows.Forms.KeyPressEventArgs e)
{
int KeyCode=(int)e.KeyChar;

//Check whether the value is alphanumeric
if(!IsNumeric(KeyCode))
e.Handled=true;
else
e.Handled=false;
}

private bool IsNumeric(int Val)
{
return ((Val>=48 && Val<=57) || (Val == 8) || (Val ==27));
}


To check for IP number the function is given below


private bool IPDotNumeric(int Val)
{
return ((Val>=48 && Val<=57) || (Val == 8) || (Val== 27)||(Val==46));
}


So with this Idea we can customize the Functions to our need.




Responses

Author: CsOver Lin    05 Oct 2004Member Level: Bronze   Points : 0
hello,the IPNumber's function is based on binary?


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Previous Resource: Format Date, numeric values in the DataGrid.
Return to Discussion Resource Index
Post New Resource
Category: Web Applications


Post resources and earn money!
 
Related Resources



Read TATA Nano reviews.
dotNet Slackers   BizTalk Adaptors    Web Design   Scripts
Are you waiting for engineering entrance result? Watch here for engineering entrance results.
silicone halloween masks

Contact Us    Privacy Policy    Terms Of Use