Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button1_Click(object sender, EventArgs e)
- {
- string[] gmail = GetGmails(txtGmail.Text);
- for (int i = 0; i < gmail.Count(); i++)
- {
- gmail[i] += "@gmail.com";
- }
- txtEmail.Lines = gmail;
- }
- /// <summary>
- /// Gets a list of all possible dot tricked gmails.
- /// </summary>
- /// <param name="acc">The account name without @gmail.com.</param>
- /// <returns>All the possible doted gmails without @gmail.com</returns>
- public string[] GetGmails(string acc)
- {
- if (acc.Length > 1 && acc.Length < 31)
- {
- string head = acc.Substring(0, 1);
- string tail = acc.Substring(1, acc.Length - 1);
- string[] tails = GetGmails(tail);
- string[] ret = new string[tails.Length * 2];
- int iRet = 0;
- foreach (string t in tails)
- {
- ret[iRet] = head.ToString() + t;
- iRet++;
- ret[iRet] = head.ToString() + '.' + t;
- iRet++;
- }
- return ret;
- }
- else
- {
- string[] ret = { acc };
- return ret;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement