2011年5月18日
摘要: 1protected void Page_Load(object sender, EventArgs e)2 {3 Bitmap bitmap = CreateBitmap(GetRandomDigit(2)+GetRandomNumbers(2));4 bitmap.Save(Response.OutputStream, ImageFormat.Jpeg);5 bitmap.Dispose();6 }7 #region 数字验证8 public string GetRandomDigit(int len)9 {10 string str = "1234567890";11 阅读全文
posted @ 2011-05-18 17:25 轻盈 阅读(197) 评论(0) 推荐(0) 编辑
  2011年5月14日
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Diagnostics;using System.IO;namespace AppleInPicture{ public partial class frmMain : Form { public frmMain() { InitializeComponen 阅读全文
posted @ 2011-05-14 17:47 轻盈 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1、定义表:Table_To_Purge [Table_Name,Day_Latency,Date_Field_Name]用于存储需要删除的表的信息,表名、删除时间、字段名2、设置一个job定期执行存储过程:EXECUTE [TISC].[dbo].[PURGE_TABLES]3、编写存储过程:CREATE PROCEDURE DBO.PURGE_TABLES ASDECLARE@tablename AS varchar(64),@daylatency AS int,@datefieldname AS varchar(64),@sqldelete AS varchar(512),@eldest 阅读全文
posted @ 2011-05-14 11:45 轻盈 阅读(307) 评论(0) 推荐(0) 编辑
摘要: asp.net 服务器获取真实IP/// <summary> /// 穿过代理服务器获取真实IP /// </summary> /// <returns></returns> public string AcceptTrueIP() { string user_IP = null; if (HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null) { user_IP = HttpContext.Current.Request.ServerVariables 阅读全文
posted @ 2011-05-14 11:21 轻盈 阅读(233) 评论(0) 推荐(0) 编辑
  2011年5月13日
摘要: public void WriteXml(string FileName, string name, string age, string hobby) { //FileName表示要使用XML文件 //初始化XML文档操作类 XmlDocument myXml = new XmlDocument(); //加载指定的XML文件 myXml.Load(FileName); //添加元素-姓名 XmlElement ele0 = myXml.CreateElement("Name"); XmlText Text0 = myXml.CreateTextNode(name); / 阅读全文
posted @ 2011-05-13 20:10 轻盈 阅读(803) 评论(0) 推荐(0) 编辑
  2011年5月11日
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf- 阅读全文
posted @ 2011-05-11 17:06 轻盈 阅读(314) 评论(0) 推荐(0) 编辑
  2011年5月4日
摘要: 在ASP.net中Repeater控件是一个经常要用到的控件,DataGrid一般都是用于以表格形式显示的情形,而在丰富多彩的网页样式的网页中,比如说BLOG,留言板等,要使用DataGrid就相对要吃力一些,Repeater比datagrid更容易定制样式,利用模板可以像在ASP中那样制作漂亮的界面。然而Repeater没有提供分页功能,那怎么来实现分页呢?方法有很多,这里我讲一上用PagedDataSource来实现Repeater的分页功能。这种方法有点类似DataGrid自带的分页功能,有一个不足之处,那就是每次都要加载所有的数据内容,这在数据量很大的时候对WEB服务器的要求比较高,效 阅读全文
posted @ 2011-05-04 17:32 轻盈 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 速预览:GridView无代码分页排序GridView选中,编辑,取消,删除GridView正反双向排序GridView和下拉菜单DropDownList结合GridView和CheckBox结合鼠标移到GridView某一行时改变该行的背景色方法一鼠标移到GridView某一行时改变该行的背景色方法二GridView实现删除时弹出确认对话框GridView实现自动编号GridView实现自定义时间货币等字符串格式GridView实现用“...”代替超长字符串GridView一般换行与强制换行GridView显示隐藏某一列GridView弹出新页面/弹出新窗口GridView固定表头(不用ja 阅读全文
posted @ 2011-05-04 10:08 轻盈 阅读(237) 评论(0) 推荐(0) 编辑
  2011年4月29日
摘要: create procedure pro_delete@deleteId intasdeclare @nodeid intdeclare @id intdeclare @pid intset @nodeid = @deleteIdset @id = @nodeidset @pid = @nodeidbegin transactionwhile(exists (select * from H where id = @nodeid))begin if(exists (select * from H where Pid = @id and id != @id) ) begin set @pid = 阅读全文
posted @ 2011-04-29 17:14 轻盈 阅读(208) 评论(0) 推荐(0) 编辑
  2011年4月19日
摘要: 第一种(务器控件):1.Default.aspx代码如下:<html xmlns="http://www.w3.org/1999/xhtml"><head> <title>文件上传</title></head><body> <form id="form1" action="Default2.aspx" enctype="multipart/form-data" method="post"> <div> 阅读全文
posted @ 2011-04-19 16:08 轻盈 阅读(623) 评论(2) 推荐(0) 编辑