ASP.Net下的HttpModule是基于事件的处理模型,这使得我们在选择事件监听和处理的时候有更多选择。下面是对HttpModule有关事件被触发的监测:

有关代码如下

using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Web.SessionState;
using System.Threading; /// ///EventTest 的摘要说明
///
public class EventTest : IHttpModule, IRequiresSessionState
{
public EventTest()
{
//
//TODO: 在此处添加构造函数逻辑
//
} void IHttpModule.Dispose()
{
return;
} void IHttpModule.Init(HttpApplication App)
{
App.AcquireRequestState += new EventHandler(AcquireRequestState);
App.BeginRequest += new EventHandler(BeginRequest);
App.AuthenticateRequest += new EventHandler(AuthenticateRequest);
App.AuthorizeRequest += new EventHandler(AuthorizeRequest);
App.Disposed += new EventHandler(Disposed);
App.EndRequest += new EventHandler(EndRequest);
App.Error += new EventHandler(Error);
//App.MapRequestHandler += new EventHandler(MapRequestHandler);
App.PostAcquireRequestState += new EventHandler(PostAcquireRequestState);
App.PostAuthenticateRequest += new EventHandler(PostAuthenticateRequest);
App.PostAuthorizeRequest += new EventHandler(PostAuthorizeRequest);
//App.PostLogRequest += new EventHandler(PostLogRequest);
App.PostMapRequestHandler += new EventHandler(PostMapRequestHandler);
App.PostReleaseRequestState += new EventHandler(PostReleaseRequestState);
App.PostRequestHandlerExecute += new EventHandler(PostRequestHandlerExecute);
App.PostResolveRequestCache += new EventHandler(PostResolveRequestCache);
App.PostUpdateRequestCache += new EventHandler(PostUpdateRequestCache);
App.PreRequestHandlerExecute += new EventHandler(PreRequestHandlerExecute);
App.PreSendRequestHeaders += new EventHandler(PreSendRequestHeaders);
App.PreSendRequestContent += new EventHandler(PreSendRequestContent);
App.ReleaseRequestState += new EventHandler(ReleaseRequestState);
App.ResolveRequestCache += new EventHandler(ResolveRequestCache);
App.UpdateRequestCache += new EventHandler(UpdateRequestCache);
} private void BeginRequest(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:BeginRequest(执行Http请求管线链中第一个事件时发生)");
} private void AcquireRequestState(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:AcquireRequestState(与当前建立会话时发生)");
if (context.Session["T"] != null)
{
response.Write(" + " + context.Session["T"].ToString());
}
else
{
response.Write(" Session未收到!");
}
} private void AuthenticateRequest(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:AuthenticateRequest(安全模块建立用户标记时发生)"); } private void AuthorizeRequest(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:AuthorizeRequest(安全模块验证用户授权时发生)"); } private void Disposed(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:Disposed(释放应用时发生)"); } private void EndRequest(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:EndRequest(执行Http请求管线链中最后一个事件时发生)"); } private void Error(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + Error(Error事件时发生)");
} private void PostAcquireRequestState(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:PostAcquireRequestState(已经获得当前请求状态时发生)");
if (context.Session["T"] != null)
{
response.Write(" + " + context.Session["T"].ToString());
}
else
{
response.Write(" Session未收到!");
}
} private void PostAuthenticateRequest(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:PostAuthenticateRequest(已建立用户标识时发生)");
} private void PostAuthorizeRequest(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:PostAuthorizeRequest(当前请求的用户已获得授权时发生)");
} private void PostMapRequestHandler(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:PostMapRequestHandler(当前请求事件映射到相应事件后发生)"); } private void PostReleaseRequestState(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + PostReleaseRequestState(完成请求事件并且请求状态已存储时发生)");
} private void PostRequestHandlerExecute(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:PostRequestHandlerExecute(ASP.Net事件执行完毕时发生)");
} private void PostResolveRequestCache(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:PostResolveRequestCache(跳过当前请求并接受来自缓存数据时发生)");
} private void PostUpdateRequestCache(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:PostUpdateRequestCache(事件缓存被更新时发生)"); } private void PreRequestHandlerExecute(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:PreRequestHandlerExecute(页面事件执行前发生)"); if (context.Session["T"] != null)
{
response.Write(" + " + context.Session["T"].ToString());
}
else
{
response.Write(" Session未收到!");
}
} private void PreSendRequestContent(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
//response.Write("
" + time + " + IHttpModule:PreSendRequestContent(向客户端发送内容之前发生)"); } private void PreSendRequestHeaders(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:PreSendRequestHeaders(向客户端发送HttP头之前发生)");
} private void ReleaseRequestState(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:ReleaseRequestState(事件执行完成之后状态处理)");
} private void ResolveRequestCache(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:ResolveRequestCache(从缓存中发生数据请求时)");
}
private void UpdateRequestCache(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
HttpRequest request = application.Request;
HttpResponse response = application.Response;
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
response.Write("
" + time + " + IHttpModule:UpdateRequestCache(时间执行完毕,为缓存新的事件准备)");
} }

需要在web.Config加入

<httpModules>

        <add name="Haha" type="EventTest"/>
<httpModules>

任意Page的代码(aspx)

protected void Page_Load(object sender, EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:Page_Load");
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:TextBox1_TextChanged");
Label1.Text = TextBox1.Text;
}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:TextBox2_TextChanged");
Label2.Text = TextBox2.Text;
} private void Page_LoadComplete(object sender, System.EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:Page_LoadComplete");
} private void Page_Unload(object sender, System.EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
//Response.Write("
" + time + " + Page_Unload");
} private void Page_PreInit(object sender, System.EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:Page_PreInit");
} private void Page_Init(object sender, System.EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Session["T"] = "来自Page级:Page_Init" + time;
Response.Write("
" + time + " + Page:Page_Init");
} private void Page_InitComplete(object sender, System.EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:Page_InitComplete");
} private void Page_PreLoad(object sender, System.EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:Page_PreLoad");
} private void Page_PreRender(object sender, System.EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:Page_PreRender");
} private void Page_PreRenderComplete(object sender, System.EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:Page_PreRenderComplete");
} private void Page_SaveStateComplete(object sender, System.EventArgs e)
{
string time = DateTime.Now.ToString() + ":" + DateTime.Now.Millisecond.ToString("");
Response.Write("
" + time + " + Page:Page_SaveStateComplete");
}

当Page(aspx)页面事件被加载(首次)被加载后的信息

-- ::: + IHttpModule:BeginRequest(执行Http请求管线链中第一个事件时发生)
-- ::: + IHttpModule:AuthenticateRequest(安全模块建立用户标记时发生)
-- ::: + IHttpModule:PostAuthenticateRequest(已建立用户标识时发生)
-- ::: + IHttpModule:AuthorizeRequest(安全模块验证用户授权时发生)
-- ::: + IHttpModule:PostAuthorizeRequest(当前请求的用户已获得授权时发生)
-- ::: + IHttpModule:ResolveRequestCache(从缓存中发生数据请求时)
-- ::: + IHttpModule:PostResolveRequestCache(跳过当前请求并接受来自缓存数据时发生)
-- ::: + IHttpModule:PostMapRequestHandler(当前请求事件映射到相应事件后发生)
-- ::: + IHttpModule:AcquireRequestState(与当前建立会话时发生) Session未收到!
-- ::: + IHttpModule:PostAcquireRequestState(已经获得当前请求状态时发生) Session未收到!
-- ::: + IHttpModule:PreRequestHandlerExecute(页面事件执行前发生) Session未收到!
-- ::: + Page:Page_PreInit
-- ::: + Page:Page_Init
-- ::: + Page:Page_InitComplete
-- ::: + Page:Page_PreLoad
-- ::: + Page:Page_Load
-- ::: + Page:Page_LoadComplete
-- ::: + Page:Page_PreRender
-- ::: + Page:Page_PreRenderComplete
-- ::: + Page:Page_SaveStateComplete
Label1(aspx页面的)
Label2(aspx页面的)
-- ::: + IHttpModule:PostRequestHandlerExecute(ASP.Net事件执行完毕时发生)
-- ::: + IHttpModule:ReleaseRequestState(事件执行完成之后状态处理)
-- ::: + PostReleaseRequestState(完成请求事件并且请求状态已存储时发生)
-- ::: + IHttpModule:UpdateRequestCache(时间执行完毕,为缓存新的事件准备)
-- ::: + IHttpModule:PostUpdateRequestCache(事件缓存被更新时发生)
-- ::: + IHttpModule:EndRequest(执行Http请求管线链中最后一个事件时发生)
-- ::: + IHttpModule:PreSendRequestHeaders(向客户端发送HttP头之前发生)

注意,想使用Session时,必须在AcquireRequestState,PostAcquireRequestState以及PreRequestHandlerExecute事件中.

页面事件被触发

-- ::: + IHttpModule:BeginRequest(执行Http请求管线链中第一个事件时发生)
-- ::: + IHttpModule:AuthenticateRequest(安全模块建立用户标记时发生)
-- ::: + IHttpModule:PostAuthenticateRequest(已建立用户标识时发生)
-- ::: + IHttpModule:AuthorizeRequest(安全模块验证用户授权时发生)
-- ::: + IHttpModule:PostAuthorizeRequest(当前请求的用户已获得授权时发生)
-- ::: + IHttpModule:ResolveRequestCache(从缓存中发生数据请求时)
-- ::: + IHttpModule:PostResolveRequestCache(跳过当前请求并接受来自缓存数据时发生)
-- ::: + IHttpModule:PostMapRequestHandler(当前请求事件映射到相应事件后发生)
-- ::: + IHttpModule:AcquireRequestState(与当前建立会话时发生) + 来自Page级:Page_Init2009-- :::
-- ::: + IHttpModule:PostAcquireRequestState(已经获得当前请求状态时发生) + 来自Page级:Page_Init2009-- :::
-- ::: + IHttpModule:PreRequestHandlerExecute(页面事件执行前发生) + 来自Page级:Page_Init2009-- :::
-- ::: + Page:Page_PreInit
-- ::: + Page:Page_Init
-- ::: + Page:Page_InitComplete
-- ::: + Page:Page_PreLoad
-- ::: + Page:Page_Load
-- ::: + Page:TextBox1_TextChanged
-- ::: + Page:Page_LoadComplete
-- ::: + Page:Page_PreRender
-- ::: + Page:Page_PreRenderComplete
-- ::: + Page:Page_SaveStateComplete
aspx 页面信息
-- ::: + IHttpModule:PostRequestHandlerExecute(ASP.Net事件执行完毕时发生)
-- ::: + IHttpModule:ReleaseRequestState(事件执行完成之后状态处理)
-- ::: + PostReleaseRequestState(完成请求事件并且请求状态已存储时发生)
-- ::: + IHttpModule:UpdateRequestCache(时间执行完毕,为缓存新的事件准备)
-- ::: + IHttpModule:PostUpdateRequestCache(事件缓存被更新时发生)
-- ::: + IHttpModule:EndRequest(执行Http请求管线链中最后一个事件时发生)
-- ::: + IHttpModule:PreSendRequestHeaders(向客户端发送HttP头之前发生)

以下为摘录,用于加深事件模型的理解

Page 执行中将按照如下顺序激活事件:

Page.PreInit
Page.Init
Page.InitComplite
Page.PreLoad
Page.Load
Page.LoadComplete
Page.PreRender
Page.PreRenderComplete 如果页面从令一个页面继承,如BasePage:System.Web.UI.Page,在BasePage中做了一些扩展,如权限检查,而其他页面从BasePage继承,则BasePage和最终Page的事件激活顺序是: UI.PreInit
Page.PreInit
UI.Init
Page.Init
UI.InitComplite
Page.InitComplite
UI.PreLoad
Page.PreLoad
UI.Load
Page.Load
UI.LoadComplete
Page.LoadComplete
UI.PreRender
Page.PreRender
UI.PreRenderComplete
Page.PreRenderComplete 如果使用了MasterPage,则MasterPage中的事件和ContentPage中的事件按照下面顺序激活: ContentPage.PreInit
Master.Init
ContentPage.Init
ContentPage.InitComplite
ContentPage.PreLoad
ContentPage.Load
Master.Load
ContentPage.LoadComplete
ContentPage.PreRender
Master.PreRender
ContentPage.PreRenderComplete 更进一步,如果ContentPage继承BasePage,那么,各事件的执行顺序将变成: UI.PreInit
ContentPage.PreInit
Master.Init
UI.Init
ContentPage.Init
UI.InitComplite
ContentPage.InitComplite
UI.PreLoad
ContentPage.PreLoad
UI.Load
ContentPage.Load
Master.Load
UI.LoadComplete
ContentPage.LoadComplete
UI.PreRender
ContentPage.PreRender
Master.PreRender
UI.PreRenderComplete
ContentPage.PreRenderComplete
MasterPage UserControlOnTop Page UserControlInPage UserControlOnButtom
  Init      
      Init  
        Init
Init        
    Init    
    Load    
Load        
  Load      
      Lod  
        Load
ControlEvents ControlEvents ControlEvents ControlEvents ControlEvents
    PreRender    
PreRender        
  PreRender      
      PreRender  
        PreRender
  UnLoad      
      UnLoad  
        UnLoad
UnLoad        
    UnLoad    

[Log]ASP.NET之HttpModule 事件执行顺序的更多相关文章

  1. jquery ajax中各个事件执行顺序如下

    $(function(){ setTimeout(function(){ $.ajax({ url:'/php/selectStudent.php', }); },0); $(document).aj ...

  2. ASP.NET Page对象各事件执行顺序(转)

    很久没写 asp.net 的东西了,search 了一下 page 的事件执行顺序,找到如下的东西,仅仅做记录用 Page.PreInit 在页初始化开始时发生 Page.Init 当服务器控件初始化 ...

  3. ASP.NET MVC自定义Module记录管道事件执行顺序

    1. 在Visual Studio 新建项目,模板为空,下面结构选择MVC. 2. 在项目中新建一个类MyModule,实现IHttpModule接口 namespace SimpleApp.Infr ...

  4. Web高级 Eventloop和事件执行顺序

    1. EventLoop 1.1 调用栈 当一个方法执行时内部调用另外的方法,则会形成调用栈,如图: 1.2 任务队列 JavaScript有一个主线程执行当前任务,主线程的代码同步执行,并把遇到的事 ...

  5. 关于js事件执行顺序

    关于js事件执行顺序小技巧 js事件执行顺序是js中一个老生常谈的一个话题, 聊这个话题之前我们先谈谈怎么给页面元素绑定我们需要的事件 1.给页面元素绑定事件 a)直接在元素上面加上需要绑定的事件,如 ...

  6. 关于js事件执行顺序小技巧

    js事件执行顺序是js中一个老生常谈的一个话题, 聊这个话题之前我们先谈谈怎么给页面元素绑定我们需要的事件 1.给页面元素绑定事件 a)直接在元素上面加上需要绑定的事件,如 <button ty ...

  7. jquery ajax 中各个事件执行顺序

    jquery ajax 中各个事件执行顺序如下: 1.ajaxStart(全局事件) 2.beforeSend 3.ajaxSend(全局事件) 4.success 5.ajaxSuccess(全局事 ...

  8. Wex5页面事件执行顺序

    wex5 事件执行顺序data组件的onCustomRefresh→ model组件的onLoad→ windowReceiver组件的onReceive

  9. jquery中各个事件执行顺序如下:

    jquery中各个事件执行顺序如下: 1.ajaxStart(全局事件) 2.beforeSend 3.ajaxSend(全局事件) 4.success 5.ajaxSuccess(全局事件) 6.e ...

随机推荐

  1. UIImage 读取图片内存优化

    在图片处理时,我们总会遇到一些内存优化的问题. ​这里介绍的是其中一种内存优化处理方式. 场景: App 运行很卡,然后我用 Instruments 中的相关工具查看对象的内存占用情况,发现当图片加载 ...

  2. vue父组件向子组件动态传值的两种方法

    在一些项目需求中需要父组件向子组件动态传值,比如我这里的需求是,父组件动态通过axios获取返回的图片url数组然后传给子组件,上传图片的子组件拿到该数组后进行遍历并展示图片,因为有时候获取到的会是空 ...

  3. 一分钟理清Vue-cli 代码构建步骤。

    1. $ npm install vue -cli -g $ vue init webpack project-name $ cd project-name $ npm install $ npm r ...

  4. jekins job configure找不到remote trigger(script)

    今天想测试一下,remote的方式启动一个job,但是在“构建触发器”一栏根本找不到remote trigger,很惊讶的是在网上所有的doc或者demo里都是有这个选项的. 最后,终于找到了原因: ...

  5. varchar和nvarchar的区别 数据来证明

    如果一个数据是"N好"数据类型是varchar时: select len(vartest) from testselect datalength(vartest) from tex ...

  6. js将json数据以csv格式下载

    摘要: 最近有一个非项目的小需求,就是将项目开发分工文件化,方便后期管理维护.但是开发时,分工安排都是以json格式记录的,所以就做了一个将json数据以csv格式下载到本地. 代码: <!DO ...

  7. 【linux】 linux 禁止ping

    linux 禁止 ping 一.修改内核参数 1.临时允许PING操作的命令为:echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all 2.永久允许PIN ...

  8. my-small.ini、my-medium.ini、my-large.ini、my-huge.ini文件的作用

    安装完mysql之后或者是下载的免安装版解压之后,默认是没有my.ini文件的.但是,有几个类似的文件,如my-small.ini.my-medium.ini.my-large.ini.my-huge ...

  9. Java md5加密 控制台传入与web传入参数 结果不匹配 || 相同字符串加密结果不同,如何保证JAVA MD5加密结果在不同的环境下都相同

    开发中遇到md5加密不一致问题,排除了上下文编码,加密内容问题. 爬了各类资料,最终找到了原因. /** 对字符串进行MD5加密 */ private static String encodeByMD ...

  10. mysql的wait_timeout配置(此处处理方法是有问题的,不建议作为操作参考)

    mysql数据库有一个wait_timeout的配置,默认值为28800(即8小时). 在默认配置不改变的情况下,如果连续8小时内都没有访问数据库的操作,再次访问mysql数据库的时候,mysql数据 ...