IT
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 55 下一页
摘要: 在事件里调用 this.Export("application/ms-excel", "凭证导出" + DateTime.Now.ToString("yyyyMMddhhmmss")); 即可 private void Export(string FileType, string FileName) { switch (FileType) { case "application/ms-excel": ExportExcel(GetOutHtml(), FileName); break; default: break 阅读全文
posted @ 2011-09-27 21:45 liufei 阅读(240) 评论(0) 推荐(0)
摘要: public void ListFiles(FileSystemInfo info){if (!info.Exists) return;DirectoryInfo dir = info as DirectoryInfo;//不是目录if (dir == null) return;FileSystemInfo[] files = dir.GetFileSystemInfos();for (int i = 0; i < files.Length; i++){FileInfo file = files[i] as FileInfo;//是文件if (file != null){//Consol 阅读全文
posted @ 2011-09-23 15:58 liufei 阅读(515) 评论(0) 推荐(0)
摘要: 文件上传的控件,支持上传后事件,跨服务器上传,自定义可上传文件类型、大小,以及上传文件命名规则。1usingSystem.Web.UI.HtmlControls;2usingSystem.Configuration;3usingSystem.ComponentModel;4usingSystem.Web.Security;5usingSystem.Security.Principal;6usingSystem.Drawing;7usingSystem.Drawing.Text;8usingSystem.Collections;9usingSystem.Collections.Specializ 阅读全文
posted @ 2011-09-15 13:41 liufei 阅读(322) 评论(0) 推荐(0)
摘要: protected void Page_Load(object sender, EventArgs e) { Response.Write(LoanCapital(2596736)); Response.End(); } public static string LoanCapital(decimal num) { string str1 = "零壹贰叁肆伍陆柒捌玖"; //0-9所对应的汉字 string str2 = "万仟佰拾亿仟佰拾万仟佰拾元角分"; //数字位所对应的汉字 string str3 = ""; //从原num值 阅读全文
posted @ 2011-09-05 17:50 liufei 阅读(1068) 评论(0) 推荐(0)
摘要: clbd_control 将字符串转换为 int这些示例演示了一些用于将 string 转换为 int 的不同方法。例如,当从命令行参数获取数值输入时,此类转换会很有用。还存在一些将字符串转换为其他数值类型(如 float 或 long)的类似方法。下表列出了其中的一些方法。数值类型方法decimalToDecimal(String)floatToSingle(String)doubleToDouble(String)shortToInt16(String)longToInt64(String)ushortToUInt16(String)uintToUInt32(String)ulongToU 阅读全文
posted @ 2011-09-05 09:57 liufei 阅读(578) 评论(0) 推荐(0)
摘要: 方法一 OriginalStr 字符串中间用,分割 SplitChar 要分割的符合调用方法如下 示例 splitvalue 是'fnc_split' 中临时表中的字段@configvaluestr 整个字符串 billnamestr 要查找的字符串if((Select splitvalue From dbo.fnc_split(@configvaluestr,',') where splitvalue=@billnamestr) is not null)begin insert into @BusinessCashRequirementTB select 1- 阅读全文
posted @ 2011-09-02 17:18 liufei 阅读(491) 评论(0) 推荐(0)
摘要: 一个月的第一天 第一个例子,我将告诉你如何从当前日期去这个月的最后一天。请注意:这个例子以及这篇文章中的其他例子都将只使用DATEDIFF和DATEADD函数来计算我们想要的日期。每一个例子都将通过计算但前的时间间隔,然后进行加减来得到想要计算的日期。 这是计算一个月第一天的SQL 脚本: SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0) 我们把这个语句分开来看看它是如何工作的。最核心的函数是getdate(),大部分人都知道这个是返回当前的日期和时间的函数。下一个执行的函数DATEDIFF(mm,0,getdate())是计算当前日期和“... 阅读全文
posted @ 2011-08-26 01:18 liufei 阅读(202) 评论(0) 推荐(0)
摘要: HashTable的应用非常广泛,HashMap是新框架中用来代替HashTable的类,也就是说建议使用HashMap,不要使用HashTable。可能你觉得HashTable很好用,为什么不用呢? 这里简单分析他们的区别。 1.HashTable的方法是同步的,HashMap未经同步,所以在多线程场合要手动同步HashMap这个区别就像Vector和ArrayList一样。 2.HashTable不允许null值(key和value都不可以),HashMap允许null值(key和value都可以)。 3.HashTable有一个contains(Object value),功能和cont 阅读全文
posted @ 2011-07-29 18:02 liufei 阅读(569) 评论(0) 推荐(0)
摘要: 在几千条记录里,存在着些相同的记录,如何能用SQL语句,删除掉重复的呢?谢谢! 1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断 select * from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录 delete from people where peopleId in (select people 阅读全文
posted @ 2011-07-19 17:05 liufei 阅读(202) 评论(0) 推荐(0)
摘要: 在Asp.net的HttpCookie中写入汉字,读取值为什么全是乱码?其实这是因为文字编码而造成的,汉字是两个编码,所以才会搞出这么个乱码出来!其实解决的方法很简单:只要在写入Cookie时,先将其用Url编码,然后再写入,当我们读取时再解码就OK了,希望更多的学生妹妹能解决它,呵呵! 例子: Cookie的写入:1HttpCookie cookie=new HttpCookie("Simple");2cookie.Values.Add("Simple1",HttpUtility.UrlEncode("大叔,你好!"));3cook 阅读全文
posted @ 2011-07-18 11:00 liufei 阅读(354) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 55 下一页