Показать сообщение отдельно

  #2  
Старый 19.07.2010, 10:08
KATYA
Участник форума
Регистрация: 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;

namespace
std

{



class
sto

{

static
void 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();

var
login= new List();

var
pass= new List();

File.ReadAllLines("out.txt").ToList().ForEach(s=>

{

var
arr=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"]
 
Ответить с цитированием