摘要:
1.aspx文件:public void SetLabel(string str) { this.Label1.Text = str; ; } ascx文件;protected void Button1_Click(object sender, EventArgs e) { System.Web.UI.Page p = this.Page; Type pageType = p.GetType();... 阅读全文
摘要:
private void CreateImage(string checkCode) { int iwidth = (int)(checkCode.Length * 15); System.Drawing.Bitmap image = new System.Drawing.Bitmap(iwidth, 25); Graphics g = Graphics.FromImage(image); g.C... 阅读全文
摘要:
protected void Page_Load(object sender, EventArgs e) { SqlConnection myConnection = new SqlConnection("server=Localhost;database=pubs;uid=sa;pwd=;");//创建SQL连接 SqlCommand myCommand = new SqlCommand("... 阅读全文
摘要:
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=curre... 阅读全文
摘要:
<%$ %>获取App_GlobalResources中message.resx文件中的B0011对应的字符串 <asp:Button ID="btnExecute" runat="server" CssClass="pressedbutton" Font-Bold="True" Text="<%$ Resources:Message, B0011 %>" />... 阅读全文
摘要:
.NET提供了进行数据加密类,下面就用例子进行说明如何使用MD5进行数据加密。 首先,创建一个UserAccount表,字段两个:UserName和Password,类型分别为varchar(25)和binary(16),下面的ASP.NET代码就是创建用户时的具体实现: <%@ Import Namespace="System.Security.Cryptography" %><... 阅读全文
摘要:
作者:webabcd控件开发扩展GridView控件(一)——鼠标经过行时改变行的样式扩展GridView控件(二)——给字段标题加上排序状态扩展GridView控件(三)——单击命令按钮弹出确认框扩展GridView控件(四)——每行复选框的全选与取消全选扩展GridView控件(五)——固定表头、指定行或指定列扩展GridView控件(六)——数据行响应鼠标的单击和双击事件扩展GridView... 阅读全文
摘要:
阅读全文
摘要:
关于Sql注入的基本概念,相信不需多说,大家都清楚,经典的注入语句是' or 1=1--单引号而截断字符串,“or 1=1”的永真式的出现使得表的一些信息被暴露出来,如果sql语句是select * from 的话,可能你整个表的信息都会被读取到,更严重的是,如果恶意使用都使用drop命令,那么可能你的整个数据库得全线崩溃。 当然,现在重点不是讲sql注入的害处,而是说说如何最大限度的避免注入问... 阅读全文
摘要:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mao.ascx.cs" Inherits="mao" %><asp:Repeater ID="rpt_mao" runat="server"><ItemTemplate><a href='<%# Eval("link") %&g... 阅读全文