125 lines
3.2 KiB
C#
125 lines
3.2 KiB
C#
using SteamWare;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace MoonProTablet
|
|
{
|
|
public partial class About : System.Web.UI.Page
|
|
{
|
|
protected Assembly assembly = Assembly.GetExecutingAssembly();
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
lblDllVersion.Text = librariesVers;
|
|
if(!Page.IsPostBack)
|
|
{
|
|
// faccio reset... sessioni e vocabolario..
|
|
doReset();
|
|
}
|
|
}
|
|
|
|
private void doReset()
|
|
{
|
|
string action = memLayer.ML.QSS("Action");
|
|
string testo = "<h3>Reset Actions</h3>";
|
|
long recPrev = 0;
|
|
long recPost = 0;
|
|
if (action != "")
|
|
{
|
|
if (action.Contains("C"))
|
|
{
|
|
recPrev = Cache.Count;
|
|
// reset dati in cache...
|
|
memLayer.ML.flushRegisteredCache();
|
|
recPost = Cache.Count;
|
|
testo += string.Format("Reset Cache: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
if (action.Contains("D"))
|
|
{
|
|
recPrev = memLayer.ML.numRecAppConf;
|
|
// reset dati in cache x DbConfig...
|
|
memLayer.ML.resetAppConf();
|
|
recPost = memLayer.ML.numRecAppConf;
|
|
testo += string.Format("Reset DB AppConf: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
if (action.Contains("R"))
|
|
{
|
|
recPrev = memLayer.ML.numRecRedis;
|
|
// reset dati in cache x DbConfig...
|
|
memLayer.ML.redFlushKey("**");
|
|
recPost = memLayer.ML.numRecRedis;
|
|
testo += string.Format("Reset Redis: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
if (action.Contains("S"))
|
|
{
|
|
recPrev = Session.Count;
|
|
// reset dati in sessione...
|
|
Session.Clear();
|
|
recPost = Session.Count;
|
|
testo += string.Format("Reset Sessione: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
if (action.Contains("V"))
|
|
{
|
|
recPrev = DataWrap.DW.numRecVoc;
|
|
// aggiorno vocabolario
|
|
DataWrap.DW.resetVocabolario();
|
|
recPost = DataWrap.DW.numRecVoc;
|
|
testo += string.Format("Reset Vocabolario: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
}
|
|
lblOut.Text = testo;
|
|
}
|
|
|
|
public string mainAssembly
|
|
{
|
|
get
|
|
{
|
|
string answ = "";
|
|
try
|
|
{
|
|
answ = assembly.FullName;
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
}
|
|
public string runtimeImg
|
|
{
|
|
get
|
|
{
|
|
string answ = "";
|
|
try
|
|
{
|
|
answ = assembly.ImageRuntimeVersion;
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
}
|
|
public string librariesVers
|
|
{
|
|
get
|
|
{
|
|
string answ = "";
|
|
try
|
|
{
|
|
AssemblyName[] referencedAssemblyNames = assembly.GetReferencedAssemblies();
|
|
foreach (AssemblyName referencedAssemblyName in referencedAssemblyNames.OrderBy(n => n.Name))
|
|
{
|
|
answ += referencedAssemblyName.FullName + "<br/>";
|
|
}
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
}
|
|
}
|
|
} |