crixo ha scritto:
come hai gestito il global.asax?
cosa intendi per come ho gestito il global.asax?
intanto incollo di seguito il contenuto...
<%@ Application Language="C#" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
}
void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown
}
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
String stPercorsoDiArrivo = Request.ServerVariables["HTTP_REFERER"];
String stBrowserClient = Request.ServerVariables["HTTP_USER_AGENT"];
String stIPClient = Request.ServerVariables["REMOTE_ADDR"];
String stPercorsoPagina = Request.ServerVariables["PATH_TRANSLATED"];
String stPercorso = Server.MapPath("~") + "\\mdb-database\\miodb.mdb";
modDatabase.GestioneDatabase.StringaDiConnessione = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=" + stPercorso;
//Se la pagina è una della sezione statistiche non incremento il contatore
if (stPercorsoPagina.IndexOf("\\stats\\") == -1)
{
modDatabase.GestioneDatabase.Apertura();
modDatabase.GestioneDatabase.Aggionamento("INSERT INTO tblAccessi (DataAccesso, PercorsoDiArrivo, Browser, IPClient) VALUES ('" + DateTime.Now + "', '" + stPercorsoDiArrivo + "', '" + stBrowserClient + "', '" + stIPClient + "');");
modDatabase.GestioneDatabase.ReperisciValori("SELECT TOP 1 ID AS Valore FROM tblAccessi ORDER BY DataAccesso DESC;");
modDatabase.GestioneDatabase.myReader.Read();
modDatabase.GestioneDatabase.IDClient = (Int32)modDatabase.GestioneDatabase.myReader["Valore"];
modDatabase.GestioneDatabase.myReader.Close();
modDatabase.GestioneDatabase.Chiusura();
}
}
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
}
</script>