protected void RefreshLogLines(object sender, StoreRefreshDataEventArgs e) { JavaScriptSerializer serializer = new JavaScriptSerializer(); CommonDomain provider = new CommonDomain(); List<object> data = new List<object>(); string[] lines = File.ReadAllLines(string.Format("c:\\Logs\\Advance\\{0}", listFilesSelect.Value.ToString())); int lineIndex = 0; foreach (string line in lines) { LogLine logLine = new LogLine(line); data.Add(new { evTime = logLine.Time.ToString("HH:mm:ss"), evUser = provider.Users.Single(us => us.ID == logLine.UserID).Name, evLevel = logLine.Level, evObject = logLine.Object, evAction = logLine.Action, evIndex = lineIndex }); ++lineIndex; } logLinesStore.DataSource = data; logLinesStore.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string[] lines = File.ReadAllLines(string.Format("c:\\Logs\\Advance\\{0}", Request["logFile"].ToString())); LogLine logLine = new LogLine(lines[Convert.ToInt32(Request["lineNumber"])]); if (logLine.Object == "Configuration") { JavaScriptSerializer serializer = new JavaScriptSerializer(); ConfigurationData data = serializer.Deserialize<ConfigurationData>(logLine.Data); ProductCard1.DataSource = data.Properties.ToList(); // .Select(it => new Pair<string,object>(it.Name, it.NewValue)).ToList(); ProductCard1.DataBind(); } }