评论乙脑peux axtraire DESdonnéesD'UN fichier日志ET LES stokcker ailleurs
[编辑]代码块,受译(通过谷歌)和身体移动 - OriginalGriff [/编辑]| ammou004using System;
using System.IO;
using System.Text.RegularExpressions;
class Program
{
public struct command
{
public int com, side, clientAppliId, quantity, price, validity;
public int modality, clientCodeType, subNegociationCode, subClassOrder;
public int origTime, tradingPhase, postingMode, clearingMode, TON, restriction, settlementType;
public int applicationFlag, mnemo, GLID, typeMessage, classOrder, noUti;
public string currency, confirmation;
}
static void Main()
{
Regex g = new Regex(@"(?<h>\d+) <min>\d+) <sec>\d+) <ms>\d+)+ GLDataCmd");
Regex g2=new Regex(@"SCRecord");
Regex g2_fin = new Regex(@"}");
using (StreamReader r = new StreamReader("C:\\Program Files\\GLTrade\\slev5\\log\\P10_P3_recv_20110817.log"))
{
string line;
while ((line = r.ReadLine()) != null)
{
Match m=g.Match(line);
if ( m.Success)
{
Console.WriteLine(line);
while ((line = r.ReadLine()) != null)
{
Match c = g2.Match(line);
if (c.Success)
{
Console.WriteLine(line);
while ((line = r.ReadLine()) != null)
{
Match k = g2_fin.Match(line);
if (!k.Success)
{
Console.WriteLine(line);
}
else { break; }
}
break;
}
}
//string v = m.Groups[1].Value;
//string w = m.Groups[2].Value;
}
}
Console.ReadLine();
}
}
}