-
student
a program of students info system,welcome to use.
- 2012-06-05 14:53:34下载
- 积分:1
-
演奏乐谱的C程序
演奏乐谱的C程序-performance scores of C-
- 2022-10-07 02:55:02下载
- 积分:1
-
红外远程
这是红外遥控器的测试程序
- 2022-01-25 16:09:15下载
- 积分:1
-
asp.net防刷新(F5) 禁止重复提交 实例(附完整源码)
实现了用户操作时 刷新导致的重复操作问题。 实现原理如下: 使用一个上下文唯一的票据号,该票据号随页面提交或回发而递增,每当用户与服务器端交互时,代码会提取上次的票据号码并与当前票据号码比较,如果当前票据大于上次的票据,则是提交或回发,否则则识别为刷新。 这种方式会用到HttpMoudel,并在其中操作Session。 使用方法如下: 1、引入dll MsdnExt 压缩包中有2.修改web.config,在 添加以下item: 其中“MsdnModule”是一个名字, “Msdn.RefreshModule”是“Msdn”下的“RefreshModule”类型,“MsdnExt”是程序集的名字 3.引入命名空间 using Msdn; 并修改页面类继承Msdn.Page 4.使用代码 代码: protected void Button1_Click(object sender, EventArgs e) { if (!IsPageRefresh) Response.Write("按钮事件"); else Response.Write("页面刷新");TrackRefreshState();} MSDNPage.cs 核心代码如下:using System;using System.Web.UI;using System.Web;using System.Text;namespace Msdn{ public class Page : System.Web.UI.Page { #region Constants // *********************************************************** // Constants public const string RefreshTicketCounter = "RefreshTicketCounter"; private const string SetFocusFunctionName = "__setFocus"; private const string SetFocusScriptName = "__inputFocusHandler"; // *********************************************************** #endregion // *********************************************************** // Ctor public Page() { m_focusedControl = ""; // Register a PreRender handler this.PreRender = new EventHandler(RefreshPage_PreRender); } // *********************************************************** // ************************************************************** // Indicates if the page is being viewed in response to F5 hit public bool IsPageRefresh { get { object o = HttpContext.Current.Items[RefreshAction.PageRefreshEntry]; if (o == null) return false; return (bool) o; } } // ************************************************************** // ************************************************************** // Increase the internal counter used to generate refresh tickets public void TrackRefreshState() { InitRefreshState(); int ticket = Convert.ToInt32(Session[RefreshTicketCounter]) 1; Session[RefreshTicketCounter] = ticket; } // ************************************************************** // ************************************************************** // Set the control with the input focus public void SetFocus(string ctlId) { m_focusedControl = ctlId; } // ************************************************************** #region Private Members // ************************************************************** // Create the hidden field to store the current request ticket private void SaveRefreshState() { int ticket = Convert.ToInt32(Session[RefreshTicketCounter]) 1; RegisterHiddenField(RefreshAction.CurrentRefreshTicketEntry, ticket.ToString()); } // ************************************************************** // ************************************************************** // Ensure that the ticket counter is initialized private void InitRefreshState() { if (Session[RefreshTicketCounter] == null) Session[RefreshTicketCounter] = 0; } // ************************************************************** // ************************************************************** // Handle the PreRender event private void RefreshPage_PreRender(object sender, EventArgs e) { SaveRefreshState(); AddSetFocusScript(); } // ************************************************************** // ************************************************************** // Add any script code required for the SetFocus feature private void AddSetFocusScript() { if (m_focusedControl == "") return; // Add the script to declare the function // (Only one form in ASP.NET pages) StringBuilder sb = new StringBuilder(""); sb.Append(""); sb.Append("function "); sb.Append(SetFocusFunctionName); sb.Append("(ctl) {"); sb.Append(" if (document.forms[0][ctl] != null)"); sb.Append(" {document.forms[0][ctl].focus();}"); sb.Append("}"); // Add the script to call the function sb.Append(SetFocusFunctionName); sb.Append("(); sb.Append(m_focusedControl); sb.Append();"); // Register the script (names are CASE-SENSITIVE) if (!IsStartupScriptRegistered(SetFocusScriptName)) RegisterStartupScript(SetFocusScriptName, sb.ToString()); } // ************************************************************** #endregion #region Private Properties // *********************************************************** // Private properties private string m_focusedControl; // *********************************************************** #endregion }}
- 2021-03-16 17:39:21下载
- 积分:1
-
HexEdit - Window 二进制文件编辑器
翻译 maninwest@Codeforge 作者:Andrew Phillips@CodeProject HexEdit是使用 C++ 编写的,此版本需要 VS2008 (带有功能包)/VS2010或者以上版本提供的最新的 MFC。现在也有个适用于 VS2012 (Visual Studio 11)的项目文件。功能HexEdit 有很多有用功能,详情见 http://www.hexedit.com/hex-edit-features.htm 或在帮助中概览功能。
- 2022-03-01 10:08:55下载
- 积分:1
-
(c#)IC卡数据读取,通讯方式为串口通讯
(c#)IC卡数据读取,通讯方式为串口通讯-(C#) IC card data read means of communication for the Serial Communications
- 2023-07-04 14:20:03下载
- 积分:1
-
描述TabControl控件的使用,如HotTrack等等属性
描述TabControl控件的使用,如HotTrack等等属性-TabControl described the use of controls, such as HotTrack attributes, etc.
- 2022-07-25 22:43:41下载
- 积分:1
-
国密SM4加密_2020
国密SM4加密_2020
- 2020-12-05下载
- 积分:1
-
libnodave库
西门子PLC与PC编程通用函数库,自带例程,可直接使用
- 2023-02-18 09:35:03下载
- 积分:1
-
若要安装到您的苹果设备的投资促进机构
撰写的 shell 脚本。你可以使用它来安装你 iOS 应用程序包,请参阅设备被连接。欢迎您提交问题!!!
- 2022-05-13 00:46:49下载
- 积分:1