How do I solve my problem with ouput?

  • Thread starter Thread starter BataBo Jokviu
  • Start date Start date
B

BataBo Jokviu

Guest
Here's my code

using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;


namespace ConsoleApp3
{
class Domainadder
{

static Regex Hashemailfinder = new Regex(":(.+?):");

public void DomainadderObject()
{


var lines = File.ReadLines("DList.txt");
var domains = File.ReadLines("Domains.txt");
var domainincontext = "";
var username = "";
var mail = "";
int counter = 0;
while (counter <= File.ReadLines("DList.txt").Count() * File.ReadLines("Domains.txt").Count())
{
foreach (var name in lines)
{

string pattern1 = @":.*?:";
string replacement1 = ":";
string RemoveHash = Regex.Replace(name, pattern1, replacement1, RegexOptions.IgnoreCase);
string pattern2 = @"\:.*";
string replacement2 = "";
var userRandom = Regex.Replace(RemoveHash, pattern2, replacement2, RegexOptions.IgnoreCase);
string user = userRandom.ToLower();
username = user;

var emailGroup = Hashemailfinder.Matches(name).Cast<Match>().Single().Groups[1];
string email = emailGroup.ToString().ToLower();
mail = email;
counter++;

}

foreach (var domain in domains)
{
domainincontext = domain;

var userplusdomain = username + domainincontext;
Console.WriteLine(userplusdomain);
string checkHash = EasyEncryption.MD5.ComputeMD5Hash(userplusdomain);
Console.WriteLine(checkHash);
counter++;


}

}




Console.ReadLine();

}








}

}




Content of DList:

etherlin:bc3e9083a5e227565aec172265cbc18f:test
frasermac101:1523112692f44f0b3d14e7a979096808:test

Content of Domains:

@yahoo.com
@gmail.com

Output I want:

etherlin@yahoo.com

somehash

etherlin@gmail.com

somehash


frasermac101@yahoo.com
somehash
frasermac101@gmail.com
somehash

Output I get:

frasermac101@yahoo.com
4b9c12e13196862e166182fdf0796bdf
frasermac101@gmail.com
1523112692f44f0b3d14e7a979096808
frasermac101@yahoo.com
4b9c12e13196862e166182fdf0796bdf
frasermac101@gmail.com
1523112692f44f0b3d14e7a979096808

Continue reading...
 
Back
Top