博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

文章分类 -  c#

摘要:/// 执行多条SQL语句,实现数据库事务。 /// ///多条SQL语句 ///影响的记录数 publicstaticint ExecuteSqlTran(List<String> SQLStringList) { using (SqlConnection conn =new SqlConnection(connectionString)) { conn.Open(); SqlCommand cmd =new SqlCommand(); cmd.Connection = conn; SqlTransaction tx = ... 阅读全文

posted @ 2013-01-22 16:36 一刻 阅读(1456) 评论(0) 推荐(0)

摘要:Form.DefaultButton = this.imgBtnLogin.ID.ToString();Form属性的DefaultButton属性 阅读全文

posted @ 2011-03-08 13:07 一刻 阅读(173) 评论(0) 推荐(0)

摘要:http://blog.csdn.net/adrain_sengtang/archive/2008/10/26/3151717.aspx1、什么是反射 Reflection,中文翻译为反射。 这是.Net中获取运行时类型信息的方式,.Net的应用程序由几个部分:‘程序集(Assembly)’、‘模块(Module)’、‘类型(class)... 阅读全文

posted @ 2009-11-16 16:59 一刻 阅读(132) 评论(0) 推荐(0)

摘要:第一例:1 创建用于反射使用的DLL新建一个C#类库项目,拷贝源代码如下,编译生成DLL(假如DLL的文件名是TestReflect.dll)namespace Webtest{ //// <summary> /// ReflectTest 类。 /// </summary> public class ReflectTest { public ReflectTest() {... 阅读全文

posted @ 2009-11-16 16:50 一刻 阅读(106) 评论(0) 推荐(0)

摘要:在想做验证码生成随机数的时候想弄个不重复的,就跑网上搜了一下,发现这文章写的特别好,就转载过来,某年某月有空再来看看我们在做能自动生成试卷的考试系统时,常常需要随机生成一组不重复的题目,在.net Framework中提供了一个专门用来产生随机数的类System.Random。   对于随机数,大家都知道,计算机不可能产生完全随机的数字,所谓的随机数发生器都是通过一定的算法对事先选定的随机种子... 阅读全文

posted @ 2009-09-11 23:05 一刻 阅读(454) 评论(0) 推荐(0)

摘要:ToShortDateString:2009-9-8ToShortTimeString:11:20ToLongDateString:2009年9月8日ToLongTimeString:11:20:17ToString:2009-9-8 11:20:17 阅读全文

posted @ 2009-09-07 11:39 一刻 阅读(115) 评论(0) 推荐(0)