34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Web;
|
|
|
|
public class DBTimeManager
|
|
{
|
|
public static void setTimeEnd(string fileName, string tipoOperazione, DateTime dataInizio, string codiceRete, string codicePB, string codiceFiscale)
|
|
{
|
|
try
|
|
{
|
|
int i = int.Parse(WebConfigParameter.getParameter("LOG_TIME_DB"));
|
|
if (i == 1)
|
|
{
|
|
StreamWriter sw = null;
|
|
if (HttpContext.Current != null)
|
|
{
|
|
sw = new StreamWriter(HttpContext.Current.Server.MapPath(WebConfigParameter.getParameter("PATH_FILE_ORACLE_TIME_LOG")), true, System.Text.Encoding.Default);
|
|
}
|
|
else
|
|
{
|
|
sw = new StreamWriter(WebConfigParameter.getParameter("PATH_FILE_ORACLE_TIME_LOG"), true, System.Text.Encoding.Default);
|
|
}
|
|
DateTime dataFine = DateTime.Now;
|
|
TimeSpan tempo = dataFine.Subtract(dataInizio);
|
|
sw.WriteLine(dataInizio.ToString() + ";" + codiceRete + ";" + codicePB + ";" + codiceFiscale + ";" + fileName + ";" + tipoOperazione + ";" + tempo.TotalMilliseconds.ToString());
|
|
sw.Close();
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
|
|
}
|
|
}
|
|
} |