摘要: View Code public class GetCode{ public static int code() { Random random = new Random(); int num1 = random.Next(0, 9); int num2 = random.Next(0, 9); int num3 = random.Next(0, 9); int num4 = random.Next(1, 9); int result = num1 + num2 * 10 + num3 * 100 ... 阅读全文
posted @ 2012-06-21 14:21 ComBat 阅读(150) 评论(0) 推荐(0) 编辑
摘要: View Code 用控件进行快速开发笔记Anchor属性:控件会随着窗体拖拽而变大缩小Dock属性:向Dock属性制定的方向停靠单文档应用程序 SDI多文档应用程序 MDI创建MID窗体程序的步骤1.设置父窗体(设置窗体Form的IsMDIContainer为true)2.创建子窗体的对象3.设置子窗体的父窗体 (子窗体.MDIParent)4.调用Show()方法(子窗体.Show())MDI子窗体排列方式层叠(Cascade)水平(TileHorizontal)垂直(TileVertical)最小化(ArrangeIcons)例如: this.LayoutMdi(MdiLayout.Ca 阅读全文
posted @ 2012-06-21 13:32 ComBat 阅读(101) 评论(0) 推荐(0) 编辑
摘要: View Code <table> <p> <a href= "# " id= "javascript.a "> <img src= "images/cuxiao3.jpg" width= "500 " height= "245 " border= "0 " id= "javascript.img " style= "FILTER:blendTrans(duration=2) "alt=&quo 阅读全文
posted @ 2012-06-21 13:22 ComBat 阅读(127) 评论(0) 推荐(0) 编辑
摘要: View Code function DoCheck(name, flag) { //获取所有HTML标记name为该参数的元素,返回是一个数组 var cbID = document.getElementsByName(name); for (var i = 0; i < cbID.length; i++) { if (cbID[i].type == "checkbox")//判断是否为复选框 { if (flag) { cbID[i].checked = flag; } ... 阅读全文
posted @ 2012-06-21 13:21 ComBat 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "alert('未选择任何数据!');", true);————————————————————————————RowDataBound光棒 if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("OnMouseOver", "Color=this.style.backgroundColor;th 阅读全文
posted @ 2012-06-21 13:18 ComBat 阅读(193) 评论(0) 推荐(0) 编辑
摘要: View Code 所用到的类:TOHTML.cs————————————————————using System;using System.Collections.Generic;using System.Web;using System.IO;using System.Data;using System.Text;/// <summary>///TOHTML 的摘要说明/// </summary>public class TOHTML{ /// <summary> /// 读取htm文件内容 /// </summary> /// <pa 阅读全文
posted @ 2012-06-21 11:44 ComBat 阅读(402) 评论(0) 推荐(0) 编辑
摘要: View Code void Application_BeginRequest(object sender, EventArgs e) { //1 Regex reg = new Regex(@"news_show(\d+).html");//访问静态网址 if (reg.Match(HttpContext.Current.Request.Url.AbsolutePath).Success)//是否匹配 { string id = reg.Match(HttpContext.Current.Request.Ur... 阅读全文
posted @ 2012-06-21 11:42 ComBat 阅读(1094) 评论(0) 推荐(0) 编辑
摘要: View Code web.Config URL重写配置<?xml version="1.0" encoding="utf-8"?><configuration> <!--URL重写外加Bin下面UrlRewriter.dll,UrlRewriter.pdb--> <configSections> <section name="CustomConfiguration" type="URLRewriter.Config.UrlsSection, URLRewriter&qu 阅读全文
posted @ 2012-06-20 21:47 ComBat 阅读(736) 评论(0) 推荐(0) 编辑
摘要: 新建一个文本文档。名字取httpd.ini 后缀名为:iniView Code 首先我们要修改httpd.ini后请重启IIS把以下内容保存为httpd.ini即可:[ISAPI_Rewrite]CacheClockRate 3600RepeatLimit 32#上面三行不要改动,以下为规则设置RewriteRule /([0-9,a-z]*)/(\d+).html /$1/3wow.mobi?InfoID=$2 [I]#文件内容结束附加说明一下设置规则时的格式:I (ignore case)不管大小写强行指定字符匹配例:RewriteRule /code/project/([0-9,a-z] 阅读全文
posted @ 2012-06-20 21:45 ComBat 阅读(582) 评论(0) 推荐(0) 编辑
摘要: View Code 委托 delegate委托就是一种代理的机制,委托代理的是方法,我们只需要给这个委托类型传递一个方法的名称(方法签名),它会根据你传递的方法的名称去调用相应的方法.就像现实生活中,我需要叫别人代理我去做一些事务,我们需要告诉它替我去做什么.程序中也是如此,我们告诉委托要调用的方法让其调用相应的方法C#定义委托的语法:访问修饰符 delegate 返回值委托名(参数) 例如:public delegate void SayDelegate(String name);传给委托的方法必须与委托所编写的返回值类型与参数列表匹配,否则编译器将报错.(也就是说你编写委托的时候你为委托所 阅读全文
posted @ 2012-06-20 21:32 ComBat 阅读(122) 评论(0) 推荐(0) 编辑