随笔- 65
文章- 17
评论- 146
06 2008 档案
用户控件(.ascx)与网页间(.aspx)如何传值的几种方法
摘要: 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...阅读全文
一段常用的Page_Load事件 (如果有更好的希望大家留言)
摘要: protected void Page_Load(object sender, EventArgs e) { SqlConnection myConnection = new SqlConnection("server=Localhost;database=pubs;uid=sa;pwd=;");//创建SQL连接 SqlCommand myCommand = new SqlCommand("...阅读全文
c#.net常用函数和方法集
摘要: 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...阅读全文
ASP.NET中$#=的用法
摘要: <%$ %>获取App_GlobalResources中message.resx文件中的B0011对应的字符串 <asp:Button ID="btnExecute" runat="server" CssClass="pressedbutton" Font-Bold="True" Text="<%$ Resources:Message, B0011 %>" />...阅读全文
利用MD5加密数据库中的密码
摘要: .NET提供了进行数据加密类,下面就用例子进行说明如何使用MD5进行数据加密。 首先,创建一个UserAccount表,字段两个:UserName和Password,类型分别为varchar(25)和binary(16),下面的ASP.NET代码就是创建用户时的具体实现: <%@ Import Namespace="System.Security.Cryptography" %><...阅读全文
小记一篇~
摘要: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mao.ascx.cs" Inherits="mao" %><asp:Repeater ID="rpt_mao" runat="server"><ItemTemplate><a href='<%# Eval("link") %&g...阅读全文
VS2008.NET 