GUID转换成16位字符串或19位数据(确保唯一)

/// /// 根据GUID获取16位的唯一字符串 /// /// /// public static string GuidTo16String() { long i = 1; foreach (byte b in Guid.NewGuid().ToByteArray()) …… 阅读全文

C# 将数据导出到Execl汇总

一、asp.net中导出Execl的方法:在asp.net中导出Execl有两种方法,一种是将导出的文件存放在服务器某个文件夹下面,然后将文件地址输出在浏览器上;一种是将文件直接将文件输出流写给浏览器。在Response输出时,t分隔的数据,导出execl时,等价于分列,n等价于换行。 1、将整个html全部输出execl此法将html中所有的内容,如按钮,表格,图片等全部输出到E …… 阅读全文

asp.net中Execl文件的导入导出

/// /// 从Excel中导出数据到DataSet中 /// /// Excel文件的绝对路径 /// excel文件中的表名 /// public DataSet ExcelDataSource(string filepath, string sheetname) { string strConn; …… 阅读全文

Repeater嵌套绑定Repeater

private void RpTypeBind() { //GetQuestionTypeAndCount() 返回一个datatable this.rptypelist.DataSource = LiftQuestionCtr.GetQuestionTypeAndCount(); this.rptypelist.DataBind() …… 阅读全文

比较完善的asp.net2.0邮件发送类

using System;using System.Net.Mail;using System.IO;/// /// Utilities 的摘要说明/// public static class Utilities{ static Utilities() { // // TODO: 在此处添加构造函数逻辑 …… 阅读全文

C#图片上传,加水印,自动生成缩略图类

using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web …… 阅读全文

C#中 TrimEnd()用法

①去除最后的逗号 string str=ab,cd,ef,;str=str.TrimEnd(new char[] { ',' });返回结果则是:ab,cd,ef②去掉日期格式的00:00:00char [] strRemove={'0',':'}; lblBirthday.Text = myReader ["Birthday"].ToString().Tr …… 阅读全文

C#连接各种数据库语句(实例)

//Accessusing System.Data;using System.Data.OleDb;connString ="Provider =Microsoft.Jet.OleDb.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("~/App_Data/MyDataBase.mdb"); …… 阅读全文