160 lines
4.1 KiB
C#
160 lines
4.1 KiB
C#
using SteamWare;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace CMS_SC
|
|
{
|
|
public partial class About : System.Web.UI.Page
|
|
{
|
|
protected Assembly assembly = Assembly.GetExecutingAssembly();
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
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;
|
|
}
|
|
/// <summary>
|
|
/// Restitusice l'elenco pareto (decrescente) delle dimensioni browser registrate
|
|
/// </summary>
|
|
public string paretoBrowserSize
|
|
{
|
|
get
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
string redHash = memLayer.ML.redHash("COUNT:wh:");
|
|
int numRec = memLayer.ML.redCountKey(redHash);
|
|
Dictionary<string, string> kvp = memLayer.ML.redGetHashDict(redHash);
|
|
sb.AppendLine(string.Format("Trovate <b>{0}</b> combinazioni", numRec));
|
|
|
|
return sb.ToString();
|
|
}
|
|
}
|
|
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 + Environment.NewLine;
|
|
}
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Num di librerie inserite
|
|
/// </summary>
|
|
public int numLibraries
|
|
{
|
|
get
|
|
{
|
|
int numLib = 0; ;
|
|
try
|
|
{
|
|
AssemblyName[] referencedAssemblyNames = assembly.GetReferencedAssemblies();
|
|
foreach (AssemblyName referencedAssemblyName in referencedAssemblyNames.OrderBy(n => n.Name))
|
|
{
|
|
numLib++;
|
|
}
|
|
}
|
|
catch
|
|
{ }
|
|
return numLib;
|
|
}
|
|
}
|
|
}
|
|
} |