德国电话号码的验证码 [英] validation code for telephone number in germany

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

问题描述

尊敬的先生,

在c#中实施验证代码时,我发现了一些问题.电话号码和电子邮件ID应遵循以下格式.

电话号码如下:

dear sir,

I have found some problem when implemented the validation code in c#. The telephone number and email id should be following pattern.

Telephone number is as follows:

1. " nnn - nnn nn nn " in case of Big Cities.
1. " nnnn - nn nn nn " in case of Small Towns.

For Zwolle (Big Cities) : 038 - 123 45 67
For xyzTown(Small Cities/Town) : 0381 - 12 34 56



对于电子邮件ID:-

不应出现多个@符号..

该代码应在C#中并在asp.pages上显示该消息,但该消息应在运行时显示,并且也不应使用javascript和验证扩展程序,并且该代码应仅在c#中使用.

感谢高级...



For email id:-

more than one @ symbol should not appear..

The code should be in C# and displayed the message on the asp.pages but the message should be displayed on the runtime and also not used javascript and validation extender and the code should be used c# only.

thanks in advanced...

推荐答案



对于此要求,您可以使用内置的正则表达式验证器.有了,
德国电话号码验证器
电子邮件验证和许多其他内容
即使您需要自己的要求,也可以使用正则表达式进行指定..

希望这对您有所帮助,这就是您想要的..
Hi,

For this requirement you can use the built in regular expression validator. in that you have,
German Phone Number Validator
Email Validation and so many things
Even if you want your own requirement you can specify that also using the regular expressions..

Hope this helps you and this is what you want..


请参阅此正则表达式示例..
此处 [
See this Regular expression examples..
Here[^]


如果我正确理解了规范,您可以在电话中使用正则表达式,例如:
If I understood the spec correctly, you could use for the telephone a regular expression like:
(\d){3,4} - (\d){2,3} (\d){2} (\d){2}


但是,验证输入是一件好事,但是如果输入始终遵循严格的规则,我认为最好消除用户界面中已经存在的错误.为此,请考虑使用屏蔽的编辑控件.例如:
-
MaskedEdit演示 [ Mask TextBox ASP.NET控件 [


However, it''s a good thing to validate the input but if the input always follows strict rules, in my opinion it would be better to eliminate the errors already in the user interface. For this consider using a masked edit control.For example:
- MaskedEdit Demonstration[^]
- Mask TextBox ASP.NET Control[^]


这篇关于德国电话号码的验证码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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