随笔分类 - C#
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;using System.Reflection;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { ReflectToObject.ReflectToStudent(); //Console.ReadLine(); Console...
阅读全文
摘要:原帖地址:http://community.csdn.net/Expert/topic/5030/5030429.xml?temp=1.928347E-02一直以来用户非正常退出系统 即:用户按右上角的 X 按纽后服务器端 session 无法销毁! 一直要等到其过期时间到了才销毁 这样通过session进行在线人数统计就无法准确了!我今天试了才发现 其实关闭浏览器事件可以捕捉到的 那么我们就可以在关闭事件里调用Session.Abandon();了(我下面这个例子特别适合页面是框架结构信息管理系统,因为这个样的结构都有一个公用的主框架页面)废话少说!说正题!main.aspx1、<bo
阅读全文
摘要:1.获取Return返回值程序代码//存储过程//Create PROCEDURE MYSQL// @a int,// @b int//AS// return @a + @b//GOSqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ToString());conn.Open();SqlCommand MyCommand = new SqlCommand("MYSQL", conn);MyCommand.Comman
阅读全文
摘要:软件的运行速度必须要在用户可以接受的范围内。通常,改善那些短暂的但频繁使用的例程的速度会大幅度地提高软件的整体速度。 要改善速度,当然首先要能够量度时间。好,那我们考虑一下在跑道上的情况,枪声一响,马上按下秒表开始计时,在选手到达终点那一刻结束计时,这时就可以知道该选手所用的时间了。要开始对下一轮比赛计时前,要先将秒表归零。.NET2.0也提供了这样一个秒表:Stopwatch类,它可以比较精确地测量时间。速度测试: 软件的性能和可测性是一个复杂的主题。要确保应用程序能够满足用户的期望,就需要在开发周期内考虑它的性能和可测性。这在设计阶段至关重要,一个糟糕的设计几乎肯定会导致糟糕的用户体验。然
阅读全文
摘要:/*** pDescription: (IniFile)/p* p@version 1.0.0/p* pModifaction:(Date-Version-Author-Description)/p* p------------------------------------------------------------------------/p*/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.Int
阅读全文
摘要:/*** pDescription: (Alert)/p* p@version 1.0.0/p* pModifaction:(Date-Version-Author-Description)/p* p------------------------------------------------------------------------/p*/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Web;using Sys
阅读全文
摘要:/*** pDescription: (RegexString)/p* 记录正则表示式的字符串* p@version 1.0.0/p* pModifaction:(Date-Version-Author-Description)/p* p------------------------------------------------------------------------/p*/using System;using System.Collections.Generic;using System.Linq;using System.Text;namespa
阅读全文
摘要:/*** pDescription: (RegexMatch)/p* 判断字符串是否满足特定条件* p@version 1.0.0/p* pModifaction:(Date-Version-Author-Description)/p* p------------------------------------------------------------------------/p*/using System;using System.Collections.Generic;using System.Linq;using System.Text;using
阅读全文
摘要:private void OpenForEditSheet(string strFilePath, string strSheetName) { Microsoft.Office.Interop.Excel.ApplicationClass xlApp = new ApplicationClass(); Microsoft.Office.Interop.Excel.Workbooks xlWorkbooks; Microsoft.Office.Interop.Excel.Workbook xlWorkbook; Microsoft.Office.Interop.Excel.Worksheet
阅读全文
摘要:private void OpenForEditSheet(string strFilePath, string strSheetName) { Microsoft.Office.Interop.Excel.ApplicationClass xlApp = new ApplicationClass(); Microsoft.Office.Interop.Excel.Workbooks xlWorkbooks; Microsoft.Office.Interop.Excel.Workbook xlWorkbook; Microsoft.Office.Interop.Excel.Worksheet
阅读全文
摘要://此方法不可少public override void VerifyRenderingInServerForm(Control control) { //base.VerifyRenderingInServerForm(control); } protected void btnExpExcel_Click(object sender, EventArgs e) { this.Response.Clear(); this.Response.AppendHeader("Content-Disposition", "attachment; filename=" + DateTime.Now.To
阅读全文
摘要:private void UpdateSheet(string strFilePath, string strSheetName) { Microsoft.Office.Interop.Excel.ApplicationClass xlApp = new ApplicationClass(); Microsoft.Office.Interop.Excel.Workbooks xlWorkbooks; Microsoft.Office.Interop.Excel.Workbook xlWorkbook; Microsoft.Office.Interop.Excel.Worksheet xlWor
阅读全文
摘要:调用Excel的打印预览页面public void ExcelPrint(string strFilePath, string strSheetName) { Microsoft.Office.Interop.Excel.ApplicationClass xlApp = new ApplicationClass(); Microsoft.Office.Interop.Excel.Workbooks xlWorkbooks; Microsoft.Office.Interop.Excel.Workbook xlWorkbook; Microsoft.Office.Interop.Excel.Wor
阅读全文
摘要:前台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1%@PageLanguage="C#"AutoEventWireup="true"Debug="true"CodeFile="GridviewNested.aspx.cs"2Inherits="多层嵌套_GridviewNested"%34!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/
阅读全文
摘要:使用用户控件实现,外层GridView和内层GridView个使用一个用户控件。ucChildGridView.ascx前台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1%@ControlLanguage="C#"AutoEventWireup="true"CodeFile="ucParentGridView.ascx.cs"2Inherits="多层嵌套整行嵌套_ucParentGridView"%3linkhref="~/CSS/
阅读全文
摘要:publicenumDictOrderStatus { /// <summary> /// 运行中 /// </summary> [Description("运行中")] Running = 1, /// <summary> /// 已关闭 /// </summary> [Description("已关闭")] Stopped = 0 } publi...
阅读全文
摘要:/// <summary> /// 使用类的属性名对应DataTable中的字段名 /// </summary> public static class TableToModel { /// <summary> /// DataRow扩展方法:将DataRow类型转化为指定类型的实体 /// </summary> /// <typeparam...
阅读全文
摘要:转自: http://hi.baidu.com/daijun2007/blog/item/82c240fa91a8379d59ee90aa.htmlHTML转PDF(C#---itextsharp)一、 需求:将HTML转PDF打印。Web项目中总是有这样的需求,很是让人苦恼。二、 分析:如何完成这个工作?1、 需要解析HTML,然后利用itextsharp绘制pdf文档。解析HTML是一个很难完...
阅读全文
posted @ 2010-10-07 11:30
TNTZWC
摘要:string date, time; date = DateTime.Now.ToString("yyyyMMddhhmmssfff");time = DateTime.Now.ToLongTimeString(); time = time.Replace(":", "");这下可以记住了。
阅读全文
浙公网安备 33010602011771号