generate variants of gmail email

highsave

Новичок
Регистрация
19.09.2023
Сообщения
12
Благодарностей
3
Баллы
3
[email protected]
I want to randomly generate variants of gmail email
Randomly insert "." in asfdafasdf, with a maximum of three "
Thank you very much for your help
==========================================
[email protected]
Я хочу создать случайный вариант почтового ящика Gmail.
В asfdafasdf случайным образом вставлять "..." до трех ".
Большое спасибо за помощь.
 

BAZAg

Client
Регистрация
08.11.2015
Сообщения
1 787
Благодарностей
2 453
Баллы
113
C#:
string login="asfdafasdf"; 
string domen="@gmail.com";
List<string> list = new List<string>();

for(int i=0; i < Math.Pow(2, login.Length-1); i++){
  string w_arr = login;
  int bits = i;
  int pos = 0;
 
   while (bits>0){
    if ((bits&1)==1){     
       pos++;
       w_arr = w_arr.Insert(pos,".");     
     }
     bits=bits>>1;
     pos++;
   }
 
      string new_login = w_arr;   
    if(new_login.Count(m=> m == '.')<=3) {
        list.Add(string.Format("{0}{1}",new_login,domen));       
    }
}
return string.Join(Environment.NewLine, list);
Код:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
 

highsave

Новичок
Регистрация
19.09.2023
Сообщения
12
Благодарностей
3
Баллы
3
C#:
string login="asfdafasdf";
string domen="@gmail.com";
List<string> list = new List<string>();

for(int i=0; i < Math.Pow(2, login.Length-1); i++){
  string w_arr = login;
  int bits = i;
  int pos = 0;

   while (bits>0){
    if ((bits&1)==1){    
       pos++;
       w_arr = w_arr.Insert(pos,".");    
     }
     bits=bits>>1;
     pos++;
   }

      string new_login = w_arr;  
    if(new_login.Count(m=> m == '.')<=3) {
        list.Add(string.Format("{0}{1}",new_login,domen));      
    }
}
return string.Join(Environment.NewLine, list);
Код:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
thanks very much!!!!
 
  • Спасибо
Реакции: BAZAg

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)