using SteamWare; using System; using System.IO; using System.Linq; namespace WebLCP { public partial class showLog : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } public string outputLog { get { int lastRows = 10; string outValue = ""; string origFile = memLayer.ML.QSS("orig"); outValue += "------------ START LOG ------------
"; if (origFile != "") { // leggo file, mostro SOLO ultime 5 righe... string fullPath = Server.MapPath(origFile); try { string[] origLines = File.ReadAllLines(fullPath); // prendo ultime 5... long numLines = origLines.LongCount(); if (numLines > lastRows) { for (int i = 0; i < lastRows; i++) { outValue += $"{origLines[numLines - lastRows + i]}
"; } } else { foreach (var item in origLines) { outValue += $"{item}
"; } } } catch { outValue += $"File not found
"; } } outValue += "------------ END LOG ------------
"; return outValue; } } public string errorDescr { get { string answ = "ND"; try { answ = memLayer.ML.QSS("errorType"); } catch { } return answ; } } } }