如何在c#中检查电子邮件是否有效格式

时间:2017-01-21 11:09:42

标签: c# asp.net .net xcode email-validation

我的代码是任何人都可以纠正此问题或任何其他解决此问题的方法。  这是我到目前为止所得到的,但它似乎并没有起作用:

  int i=0,f=0;
    string n = Console.ReadLine();
    for (i = 0; i < n.Length; i++)          
        if(n[i]=='@' || n[i] == '.')              
            f = f + 1;               
    if(f==2){
console.writeline('correct')
}
    else{
console.writeline('Incorrect') 

1 个答案:

答案 0 :(得分:2)

试试这个:

{this.props.route.prop1}  // PropContent