global.asax 文件
<%@ Application Codebehind="Global.asax.vb" Inherits="globalapp" %>global.asax.vb 文件Imports system
Imports system.web
Imports System.Collections
Imports System.ComponentModel
Imports System.Web.SessionState
Imports System.IOPublic Class global
Inherits System.Web.HttpApplication
End Class程序运行
错误 1 未能加载类型“globalapp”。 E:\wz\global.asax 1错误 2 关键字作为标识符无效。 E:\wz\global.asax.vb 8 14 E:\wz\
不知怎么搞的
<%@ Application Language="C#" %><script runat="server">
void Application_Start(object sender, EventArgs e)
{
// 在应用程序启动时运行的代码
}
void Application_End(object sender, EventArgs e)
{
// 在应用程序关闭时运行的代码
}
void Application_Error(object sender, EventArgs e)
{
// 在出现未处理的错误时运行的代码
} void Session_Start(object sender, EventArgs e)
{
// 在新会话启动时运行的代码
} void Session_End(object sender, EventArgs e)
{
// 在会话结束时运行的代码。
}
</script>
global.asax是一种文件类型,类似于webconfig,是一种配置文件,只要在相应的文件里写就行了
楼主只要建个全局应用程序就行了,在资源管理器里添加,就像添加项目,添加引用一样,很简单。