2.c#winform Basic Email Analyzer

Source: Internet
Author: User

Function: Enter email address, output username and domain name

String[] String.Split (params char[] separator) (+5 overloads))

The returned string array contains the string for this instance (delimited by the elements of the specified Unicode character array)

The source code is as follows:

usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceEmail Analysis { Public Partial classForm1:form { PublicForm1 () {InitializeComponent (); }        Private voidButton1_Click (Objectsender, EventArgs e)//Enter email address, output username and domain name        {            stringemail = TextBox1.Text;//E- Mail string Save first text box                        /*string[] String.Split (params char[] separator) (+5 overloads) * Returns a string array containing the strings of this instance (delimited by the elements of the specified Unicode character array) */            string[] STRs = email. Split ('@'); if(STRs. length!=2) {MessageBox.Show ("an illegal email address! "); return;//don't forget to return.} TextBox2.Text=strs[0];//the first part of the split string is assigned to the text box 2textbox3.text=strs[1];//post-section string assignment to text box 3                    }    }}

Run:

Software: http://pan.baidu.com/s/1bnpg8d5 Password: gvq6

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.