写一个Email地址校验程序

自己写的好玩的。当然这个程序只能是自己玩玩。

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

namespace EmailAddressCheck

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("Please input your Email address");

            String emailToBeVerify=Console.ReadLine();

            char[] emailChar = emailToBeVerify.ToCharArray();          

            for (int i = 0;  i < emailChar.Length-1;i++)

            {               

                if (emailChar[i + 1].ToString().Equals("@"))

                {

                    Console.WriteLine("Valid email address");

                    break;

                }               

            }           

            Console.Read();

        }

    }

}

posted @ 2011-11-09 17:31  xiaoshiyilang  阅读(163)  评论(1编辑  收藏  举报