Запись в файл текста из текстбоксаstring html = (@">(s+)?(?<TextTeg>[^><]+)(s+)?</");
Regex re = new Regex(html, RegexOptions.IgnoreCase | RegexOptions.Compiled);
using(TextWriter tw = new StreamWriter("D:\html.txt"))
{
Match m;
string result="";
foreach (string x in richTextBox1.Lines)
{
for (m = re.Match(x); m.Success; m = m.NextMatch())
{
if (m.Groups["TextTeg"].Length > 0)
{
// string sTemp = m.Groups["TextTeg"].Value;
//Match mc = re.Match(x);
// result = mc.Value;
MessageBox.Show(sTemp);
}
tw.Write(result);
tw.Flush();
}
}
}
Вот такой код, при помощи Flush оно записывает в одну строку без пробелов, мне нужно что бы писало в столбик, или хотя бы через пробел. как это сделать?