Jump to content
keyboard_arrow_down
account_circle Sign In

Sign In



person_add Sign Up
Sign in to follow this  
Kinasih

Email to Username combo converter (Heavily Commented)

Recommended Posts

Email to username as the title says, at the same time I test my hide function!

 

Hidden Content

    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading.Tasks;
    
    /*
     * THIS EMAIL TO USERNAME GENERATOR WORKS ON THE PRINCIPLE THAT THE USER
     * OF THE ACCOUNT HAS USED THE SAME USERNAME AS HIS EMAIL USERNAME, AFTER
     * TESTING, I CAN CONFIRM THERE ARE A LOT OF PEOPLE THAT USE THE SAME
     * USERNAME.
     */
    
    
    namespace EmailToUser
    {
        class Program
        {
            static void Main()
            {
                //Read all lines from .txt file.
                string[] lines = File.ReadAllLines($"{Directory.GetCurrentDirectory()}\\source.txt"); //Directory is gotten by taking the current directory and appending the .txt file name.
    
                using (System.IO.StreamWriter file = //Using a "File Writer" that you make of a .txt file.
        new System.IO.StreamWriter($"{Directory.GetCurrentDirectory()}\\result.txt"))/*Directory is gotten by taking the current directory and appending the .txt file name.*/{
                    for (int i = 0; i < lines.Length; i++) //For each line in .txt file do this \/
                    {
                        try //TRY doing this \/ There are often errors with faulty lines in combos.
                        {
                            string[] p1 = lines[i].Split('@'); //String array of the line splitten at "@"
                            string[] p2 = lines[i].Split(':'); //String array of the line splitten at "!" after being splitten at "@"
                            //Basically what happens is email [@pruned_19753020.com] :password   <- this section gets deleted (the one that is in brackets)
    
                            file.WriteLine($"{p1[0]}:{p2[1]}"); //Write to file.
                        }
                        catch (Exception ex)/*If there is an error, catch it, store in in Exception "ex" <- Instead of the program crashing, it will just skip that combo line.*/ {
                            i++; //Instead of the program crashing, it will just skip that combo line.
                        }
                    }
                }
            }
        }
    }
     

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  





×