• 大小: 23.7MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-21
  • 语言: 其他
  • 标签: 实时  监控  

资源简介

实时监控数据库变化更新前台显示,可以实现你修改数据库的信息,就可以在前台直接看到变化。并包含详细的代码注释以及知识点整理。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace DBChangeNotifyDemo
{
    // 注意: 有关启用 IIS6 或 IIS7 经典模式的说明,
    // 请访问 http://go.microsoft.com/?linkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();

            //启动用于接收依赖项更改通知的侦听器 该通知来自由连接字符串指定的 SQL Server 实例
            //使用下面方法的前提是将对应的数据库设置为ENABLE_BROKER 设置方法就是在数据库中执行如下两句:
            //ALTER DATAbase DBName SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
            //ALTER DATAbase DBName SET ENABLE_BROKER;
            SqlDependency.Start(ConfigurationManager.ConnectionStrings[“DefaultConnection“].ConnectionString); 

        }


        protected void Application_End()
        {
            //关闭用于接收依赖项更改通知的侦听器
            SqlDependency.Stop(ConfigurationManager.ConnectionStrings[“DefaultConnection“].ConnectionString);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    3145728  2014-12-26 22:23  DBChangeNotifyDemo\DBChangeNotifyDemo\App_Data\DBChangeNotify.mdf

     文件    4784128  2014-12-26 22:23  DBChangeNotifyDemo\DBChangeNotifyDemo\App_Data\DBChangeNotify_log.ldf

     文件       1020  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\App_Start\AuthConfig.cs

     文件       2178  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\App_Start\BundleConfig.cs

     文件        284  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\App_Start\FilterConfig.cs

     文件        609  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\App_Start\RouteConfig.cs

     文件        894  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\App_Start\WebApiConfig.cs

     文件     105544  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\Antlr3.Runtime.dll

     文件      33280  2014-12-26 22:27  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DBChangeNotifyDemo.dll

     文件      79360  2014-12-26 22:27  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DBChangeNotifyDemo.pdb

     文件      66160  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\de\Microsoft.Data.Edm.resources.dll

     文件     251504  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\de\Microsoft.Data.OData.resources.dll

     文件      17512  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\de\System.Spatial.resources.dll

     文件      40960  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.AspNet.dll

     文件      84709  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.AspNet.xml

     文件     227328  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.Core.dll

     文件     600385  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.Core.xml

     文件      17920  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.OAuth.Consumer.dll

     文件      25168  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.OAuth.Consumer.xml

     文件      55808  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.OAuth.dll

     文件     104764  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.OAuth.xml

     文件     268288  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.OpenId.dll

     文件      89600  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.OpenId.RelyingParty.dll

     文件     225464  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.OpenId.RelyingParty.xml

     文件     631411  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\DotNetOpenAuth.OpenId.xml

     文件    1116760  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\Entityframework.dll

     文件    1138045  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\Entityframework.xml

     文件      65632  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\es\Microsoft.Data.Edm.resources.dll

     文件     246880  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\es\Microsoft.Data.OData.resources.dll

     文件      17496  2014-12-15 11:58  DBChangeNotifyDemo\DBChangeNotifyDemo\bin\es\System.Spatial.resources.dll

............此处省略921个文件信息

评论

共有 条评论