Line 1: #ExternalChecksum("D:\Sites\en.setgyc.es\HTDocs\global.asax","{ff1816ec-aa5e-4d10-87f7-6f4963833460}","0FFC547276F4020907CDFA1B0140B6659C72B726")
Line 2: '------------------------------------------------------------------------------
Line 3: ' <auto-generated>
Line 4: ' This code was generated by a tool.
Line 5: ' Runtime Version:4.0.30319.42000
Line 6: '
Line 7: ' Changes to this file may cause incorrect behavior and will be lost if
Line 8: ' the code is regenerated.
Line 9: ' </auto-generated>
Line 10: '------------------------------------------------------------------------------
Line 11:
Line 12: Option Strict Off
Line 13: Option Explicit On
Line 14:
Line 15: Imports Microsoft.VisualBasic
Line 16: Imports System
Line 17: Imports System.Collections
Line 18: Imports System.Collections.Generic
Line 19: Imports System.Collections.Specialized
Line 20: Imports System.ComponentModel.DataAnnotations
Line 21: Imports System.Configuration
Line 22: Imports System.Linq
Line 23: Imports System.Text
Line 24: Imports System.Text.RegularExpressions
Line 25: Imports System.Web
Line 26: Imports System.Web.Caching
Line 27: Imports System.Web.DynamicData
Line 28: Imports System.Web.Profile
Line 29: Imports System.Web.Security
Line 30: Imports System.Web.SessionState
Line 31: Imports System.Web.UI
Line 32: Imports System.Web.UI.HtmlControls
Line 33: Imports System.Web.UI.WebControls
Line 34: Imports System.Web.UI.WebControls.WebParts
Line 35: Imports System.Xml.Linq
Line 36:
Line 37: Namespace ASP
Line 38:
Line 39: <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()> _
Line 40: Public Class global_asax
Line 41: Inherits Global.System.Web.HttpApplication
Line 42:
Line 43: Private Shared __initialized As Boolean
Line 44:
Line 45:
Line 46: #ExternalSource("D:\Sites\en.setgyc.es\HTDocs\global.asax",3)
Line 47:
Line 48:
Line 49: Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Line 50: ' Code that runs on application startup
Line 51: End Sub
Line 52:
Line 53: Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
Line 54: ' Code that runs on application shutdown
Line 55: End Sub
Line 56:
Line 57: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Line 58: ' Code that runs when an unhandled error occurs
Line 59: 'Dim exc As Exception = Server.GetLastError
Line 60: 'Dim errMsg = Request.ServerVariables("HTTP_REFERER").ToString & vbCrLf & Request.QueryString().ToString & vbCrLf & vbCrLf
Line 61:
Line 62: 'If exc.InnerException IsNot Nothing Then
Line 63: ' errMsg += exc.ToString
Line 64: 'Else
Line 65: ' errMsg += exc.Message
Line 66: 'End If
Line 67: '' Fire email
Line 68: If InStr(errMsg, "mailguncallback", CompareMethod.Text) > 0 Then
Line 69: Exit Sub
Line 70: End If
Line 71: 'Dim sch As Object, cdoMessage As Object, cdoConfig As Object
Line 72: 'sch = "http://schemas.microsoft.com/cdo/configuration/"
Line 73: 'cdoConfig = Server.CreateObject("CDO.Configuration")
Line 74: 'cdoConfig.Fields.Item(sch & "sendusing") = 2
Line 75: 'cdoConfig.Fields.Item(sch & "smtpserverport") = 25
Line 76: 'cdoConfig.Fields.Item(sch & "smtpserver") = "auth.smtp.1and1.fr"
Line 77: 'cdoConfig.Fields.Item(sch & "smtpauthenticate") = 1
Line 78: 'cdoConfig.Fields.Item(sch & "sendusername") = "office@sftcg.fr"
Line 79: 'cdoConfig.Fields.Item(sch & "sendpassword") = "sftcgmjr"
Line 80: 'cdoConfig.fields.update()
Line 81:
Line 82: 'cdoMessage = Server.CreateObject("CDO.Message")
Line 83: 'cdoMessage.Configuration = cdoConfig
Line 84: 'cdoMessage.From = "ofec@ofec.co.uk"
Line 85: 'cdoMessage.To = "ewilliams@ofec.co.uk"
Line 86: 'cdoMessage.BCC = "kostik@ofec.co.uk"
Line 87: 'cdoMessage.Subject = "OFEC Error"
Line 88: 'cdoMessage.TextBody = errMsg
Line 89: 'cdoMessage.Send()
Line 90: 'cdoMessage = Nothing
Line 91: 'cdoConfig = Nothing
Line 92:
Line 93: ''Server.ClearError()
Line 94: ''Server.Transfer("~/Home/Error-Page.aspx")
Line 95:
Line 96:
Line 97:
Line 98: End Sub
Line 99:
Line 100: Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Line 101: ' Code that runs when a new session is started
Line 102: End Sub
Line 103:
Line 104: Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
Line 105: ' Code that runs when a session ends.
Line 106: ' Note: The Session_End event is raised only when the sessionstate mode
Line 107: ' is set to InProc in the Web.config file. If session mode is set to StateServer
Line 108: ' or SQLServer, the event is not raised.
Line 109: End Sub
Line 110:
Line 111:
Line 112: Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs)
Line 113: If Len(Request.QueryString.ToString) > 350 And InStr(Request.QueryString.ToString, "Download.aspx", CompareMethod.Text) = 0 And InStr(Request.QueryString.ToString, "Webresource", CompareMethod.Text) = 0 Then
Line 114: Response.End()
Line 115: End If
Line 116: If InStr(Request.QueryString.ToString, "declare", CompareMethod.Text) > 0 Or InStr(Request.QueryString.ToString, "sysobjects", CompareMethod.Text) > 0 Or InStr(Request.QueryString.ToString, "syscolumns", CompareMethod.Text) > 0 Or InStr(Request.QueryString.ToString, "exec ", CompareMethod.Text) > 0 Then
Line 117: Response.End()
Line 118: End If
Line 119:
Line 120: ' url rewrite filter
Line 121: Dim URL As String = Request.ServerVariables("PATH_INFO")
Line 122: Dim MyContext As HttpContext = HttpContext.Current
Line 123:
Line 124: ' custom rewrite url
Line 125: Dim myConnStr = Global.System.Configuration.ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString
Line 126: Dim arg As New System.Web.UI.DataSourceSelectArguments
Line 127: Dim dw As System.Data.DataView
Line 128: Dim myDS As New SqlDataSource
Line 129: myDS.ConnectionString = myConnStr
Line 130: Dim SQLStr = "SELECT * FROM Content WHERE '/'+[RewriteURL] LIKE '" & Request.ServerVariables("PATH_INFO") & "'"
Line 131: myDS.SelectCommand = SQLStr
Line 132: dw = myDS.Select(arg)
Line 133: 'Response.Write(Request.ServerVariables("SCRIPT_NAME"))
Line 134: 'Response.End()
Line 135:
Line 136:
Line 137: If dw.Count > 0 Then
Line 138: MyContext.RewritePath(Replace("/" & dw.Item(0)("Link"), " ", "-"))
Line 139: Else
Line 140: If System.IO.File.Exists(Server.MapPath("/Home" & URL)) Then
Line 141: MyContext.RewritePath("/Home" & URL)
Line 142: ElseIf System.IO.File.Exists(Server.MapPath("/" & URL)) Then
Line 143: ' ignore root files
Line 144: ElseIf InStr(Request.ServerVariables("SCRIPT_NAME"), ".aspx", CompareMethod.Text) Then
Line 145: MyContext.RewritePath("~/subpage.aspx?URL=" & URL & "&Script=" & Request.ServerVariables("SCRIPT_NAME"), True)
Line 146: End If
Line 147: End If
Line 148: End Sub
Line 149:
Line 150: Sub Application_PostReleaseRequestState(ByVal sender As Object, ByVal e As EventArgs)
Line 151: If Response.ContentType = "text/html" Then
Line 152: ' SEO filter - replace Home/ in a fly
Line 153: Response.Filter = New HtmlSeoFilter(Response.Filter)
Line 154: End If
Line 155: End Sub
Line 156:
Line 157: #End ExternalSource
Line 158:
Line 159:
Line 160: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 161: Public Sub New()
Line 162: MyBase.New
Line 163: If (Global.ASP.global_asax.__initialized = false) Then
Line 164: Global.ASP.global_asax.__initialized = true
Line 165: End If
Line 166: End Sub
Line 167:
Line 168: Protected ReadOnly Property Profile() As System.Web.Profile.DefaultProfile
Line 169: Get
Line 170: Return CType(Me.Context.Profile,System.Web.Profile.DefaultProfile)
Line 171: End Get
Line 172: End Property
Line 173: End Class
Line 174: End Namespace
Line 175:
|