- 博客(64)
- 资源 (4)
- 收藏
- 关注
原创 在gridView中触发事件时的注意事项
1.首先 protected void gv_Road_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { LinkButton lbtn =(LinkButton)e.Row.Cel
2007-12-14 16:50:00
638
原创 GridView获得操作列的值
第一步: protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Button btn = (Button)e.Row.Cells[3
2007-11-27 21:13:00
560
原创 dot net framework 中进行连接db2数据库的操作
1.在已经安装dot net framework 的客户端的机器上面安装并且注册db2 dot net data provider的驱动2.然后在dot net framework的命名空间中引入uing System.Data.Common程序集来3.开始进行数据库操作 DbProviderFactory factory = DbProviderFactories.GetFa
2007-11-19 11:00:00
1285
原创 sql语句来判断时间间隔的长短
"SELECT ID FROM LoginInfo WHERE DATEDIFF(minute,LastVisitTime,getdate())>20"
2007-11-15 12:56:00
1803
原创 判断两次操作的时间间隔的长短是否超过20分钟
public bool checkTime(string sessID) { //如果是超过了20分钟就返回false; //实例化数据库联接字符串 ETC.SQLHelper.ConnString = System.Configuration.ConfigurationManager.ConnectionStrings["etcConnString
2007-11-15 12:54:00
1195
原创 判断日期格式并且进行相应合法格式的转换
//来根据用户输入的数据是6,还是8位来转换成合法的日期格式 public Object getStartDate(string dt) { // 使用DateTime.TryParse() //输入的如果是数字的情况下的处理方法 if (IsNumeric(dt)) { //如果是6位数的处理方法
2007-11-15 12:52:00
1214
原创 C#检查输入的是否是数字
//检查输入的是否是数字 public bool IsNumeric(string str) { if (str == null || str.Length == 0) return false; foreach (char c in str) { if
2007-11-15 12:50:00
1008
原创 Asp.net环境下给用户发送邮件
一:命名空间如下:using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebP
2007-11-01 11:48:00
535
原创 Asp.net环境下如何生成随机图片
一,首先创建一个生成随机图片的空Aspx页面来,代码如下:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.Web
2007-11-01 11:20:00
679
原创 在SQLSERVER中创建视图的一些注意事项
创建视图 :create view tableName (列别名)可有可无with Attributeasfullselect {}with [checkOption]eg.create view view_card_trwith encryption(进行视图加密)asselect top 10 cash as cc from card_transaction whe
2007-10-29 12:03:00
3760
原创 ASP.NET(C#)程序中常用的三十三种代码
1. 打开新的窗口并传送参数: 传送参数:response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") 接收参数:string a = Request.QueryString("id");string b = Request.Qu
2007-10-26 17:08:00
405
原创 DATAGRID删除最后一行时出错的解决办法
public int lastEditPage;try{cmd.ExcuteNonquery();lastEditPage=dgPagerDel.CurrentPageIndex;if((dgPagerDel.PageCount-dgPagerDel.CurrentPageIndex==1&&dgPagerDel.Items.Count==1){if(dgPagerDel.pageCount>
2007-10-26 16:53:00
623
原创 一些常用的基本函数
asp.net基本函數大全1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3
2007-10-26 16:51:00
345
原创 生成随机验证码
新建一个页面image.aspx,添加命名空间:using System.Drawing.Imaging;using System.IO; 然后在Page_load事件拷入如下代码: //生成4位的验证码 string tmp = RndNum(4); HttpCookie a = new HttpCookie("ImageV",tmp); Response.C
2007-10-26 16:45:00
409
原创 javascript统计在线时间
您在此停留了:var id, iM = 0, iS = 1;start = new Date();function go(){now = new Date();time = (now.getTime() - start.getTime()) / 1000;time = Math.floor( time);iS = time % 60;iM = Math.floor( time / 60);if (
2007-10-26 16:39:00
681
原创 图片自适应
在最近的项目中,遇到一个问题,要实现这样的效果: 点pic_small.Aspx页面的缩略图后弹出pic_all.aspx页面,pic_all.aspx页面的大小要根据图片大小自动调整,而且要有图片的说明信息,还可以点上一幅和下一幅等进行翻页。 实现过程如下: pic_small.Aspx页面缩略图处的代码为: )" src= width="118
2007-10-26 16:37:00
461
原创 文件自动下载
FileStream fileStream =new FileStream("F://学习//时间.txt",FileMode.Open);long fileSize=fileStream.Length;Context.Response.ContentType="application/octet-stream";Context.Response.AddHeader("Content-Dispos
2007-10-26 16:33:00
638
原创 sqlserver2000安装不成功之处理
同事出差,遇到两次安装SQL不成功,这边虽然给予了他指导,他也按我说的方法,先停止服务,退出,再卸载,然后将注册表与相应安装目录也删除了,但仍然安装不了SQL,特恼火,没有办法,我只得让他重新装一下OS,就OK了。但这个方法是迫不得已,索性到网上查查相关资料,但结果都是提问的,即使有回答,答案也无非就是卸载掉再重新安装试试等此类的回复,嘿,没办法,自己整理一个,或许对安装SQL不成功的同志有所帮助
2007-10-26 15:17:00
1948
原创 创建ajax的请求对象
var XMLHttpReq=false; function createXMLHttpRequest() { if(window.XMLHttpRequest) { XMLHttpReq=new XMLHttpRequest(); } else if(window.ActiveXObject) { try {
2007-10-26 15:03:00
540
原创 div动态显示与隐藏时防止滚动条回滚
if(document.getElementById(FAQ).style.display == none) {document.getElementById(FAQ).style.display = block;} else {document.getElementById(FAQ).style.display=none;}";>" style="display:none
2007-10-26 14:53:00
1338
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅