Подскажите как разделить список вида [07.07.2010 21.49.26][samparat:123456] [07.07.2010 21.49.33][usedon:123456] [07.07.2010 21.49.43][sivility:123456] [07.07.2010 21.50.04][fernol:123456] на отдельные листы логина и пороля?
С# Net Fraemwork 3.5 входной файл in.txt (должен быть в одной директории с программой); Выходные файлы : out.txt - содержит логин:пароль pass.txt - пароли login.txt - логины PHP: 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 = new Regex(@"(\w+[:]\w+)", RegexOptions.Singleline | RegexOptions.IgnoreCase); MatchCollection collect_math = ololo.Matches(a); StreamWriter sw = new StreamWriter("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<string>(); var pass = new List<string>(); 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 = new StreamWriter("pass.txt", true); StreamWriter sw1 = new StreamWriter("login.txt", true); for (int i = 0; i < c.Length; i++) { sw1.WriteLine(login[i]); sw0.WriteLine(pass[i]); } sw1.Close(); sw0.Close(); } } } Скомпилированное чудо 6 кб Пошла я дальше ништяки курить.........