如何验证文本框 [英] How to validate a text box

查看:77
本文介绍了如何验证文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好..........



我是c#编程的初学者,想知道这段代码是如何执行的。请详细描述。



!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(),\\ d +)



很快回复将不胜感激..... !!!!



谢谢....

回复·电子邮件·查看T

解决方案

 Regex r =  new 正则表达式(  ^ [a-zA-Z0-9] * 

);
if (r.IsMatch(SomeString)){
...
}


Hello..........

I am beginner in c# programming, want to know How does this code executes. Kindly describe in detail.

!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "\\d+")

Soon reply will be appreciated.....!!!!

Thanks....
Reply·Email·View T

解决方案

Regex r = new Regex("^[a-zA-Z0-9]*


"); if (r.IsMatch(SomeString)) { ... }


这篇关于如何验证文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆