蓝色1+1
别人对我们的重要, 但我们不能失去自我 更多的时候 我们要用自己的双手去拭去旅途的灰尘 用自己的问候趋散跋涉的疲顿, 用自己的心情去珍惜每一个日子, 每一个感动

随笔分类 -  C#

从DataGrid导出Excel产生乱码的一个很好的解决方案
摘要:private void Export(System.Web.UI.WebControls.DataGrid dg,string fileName,string typeName) { System.Web.HttpResponse httpResponse = Page.Response; httpResponse.AppendHeader("Content-Dispositio... 阅读全文
posted @ 2007-08-28 09:53 BlueShell 阅读(427) 评论(0) 推荐(0)
C#验证输入的是否数字的方法
摘要:static bool IsNumeric(string str) { System.Text.RegularExpressions.Regex reg1 = new System.Text.RegularExpressions.Regex(@"^[-]?(\d+\.?\d*|\.\d+)$"); return reg1.IsMatch(str); } 阅读全文
posted @ 2005-12-05 11:56 BlueShell 阅读(208) 评论(0) 推荐(0)
c语言 ---- 经典百例
摘要:【程序1】题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?1.程序分析:可填在百位、十位、个位的数字都是1、2、3、4。组成所有的排列后再去 掉不满足条件的排列。 2.程序源代码:main(){int i,j,k;printf("\n");for(i=1;i2)/*如果是闰年且月份大于2,总天数应该加一天*/sum++;printf("It is the... 阅读全文
posted @ 2005-11-22 08:26 BlueShell 阅读(542) 评论(0) 推荐(0)
把excel 数据导入数据库
摘要://把excel 数据导入DataTable中string conStr=@" Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = "+fileAddress+";Password=;User ID=Admin;Extended Properties=Excel 8.0" ; string cmdText="select * from [S... 阅读全文
posted @ 2005-11-16 10:51 BlueShell 阅读(2229) 评论(0) 推荐(0)
自动产生一个编号,规则:年月日+当天的最大流水号加一数
摘要:/// /// 自动产生一个编号 规则:年月日+当天的最大流水号加一数 如 20050312006 /// /// [WebMethod] public string generate_task_id(System.DateTime dataTime) { string year,month,day,number; year=dataTime.Year.ToString... 阅读全文
posted @ 2005-11-14 22:19 BlueShell 阅读(1151) 评论(2) 推荐(0)
自动截取自定义字节长度并换行
摘要://// /// 桁数(byte)で文字列の一部を返す /// /// 文字列 /// 桁数 /// 文字列 public static string Splite(string str, int limLength) { // 1. 文字列の桁数(BYTE単位)は引数桁数より小さい場合、リターンする。 int MaxLength = GetByteLength(str... 阅读全文
posted @ 2005-11-13 23:05 BlueShell 阅读(513) 评论(0) 推荐(0)