
19.07.2010, 10:08
|
|
Участник форума
Регистрация: 09.02.2009
Сообщений: 229
Провел на форуме: 2856245
Репутация:
338
|
|
С# Net Fraemwork 3.5 входной файл in.txt (должен быть в одной директории с программой);
Выходные файлы :
out.txt - содержит логин:пароль
pass.txt - пароли
login.txt - логины
[PHP]
PHP:
[COLOR="#000000"]using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Text.RegularExpressions;
namespacestd
{
classsto
{
staticvoid Main()
{
string a=File.ReadAllText("in.txt");
Regex ololo= newRegex(@"(\w+[:]\w+)",RegexOptions.Singleline|RegexOptions.IgnoreCase);
MatchCollection collect_math=ololo.Matches(a);
StreamWriter sw= newStreamWriter("out.txt",true);
foreach (Match item in collect_math)
{
Console.WriteLine(item);
string b=Convert.ToString(item);
sw.WriteLine(b);
}
sw.Close();
varlogin= new List();
varpass= new List();
File.ReadAllLines("out.txt").ToList().ForEach(s=>
{
vararr=s.Split(':');
login.Add(arr[0]);
pass.Add(arr[1]);
});
string[]c=File.ReadAllLines("out.txt");
StreamWriter sw0= newStreamWriter("pass.txt",true);
StreamWriter sw1= newStreamWriter("login.txt",true);
for (int i=0;i[COLOR="#007700"]
|
|
|