- 博客(16)
- 资源 (1)
- 收藏
- 关注
原创 获取下一次执行的时间
private DateTime GetNextTime() { int space =15 //判断间隔是否有效 if (space == 0) return DateTime.MaxValue; DateTime NextTime = DateTime.Parse(System.
2013-08-13 14:01:33
606
原创 只修改时间的年月日部分 sql语句
update h_cablejoint_1009_2013 seticjsj = dateadd(d, datediff(d, icjsj , '2013-8-12') ,icjsj) where datatime between '2013/8/12 00:00:00' and '2013/8/12 23:45:00'
2013-08-13 13:54:04
3910
原创 将控制台程序改成windows服务
1、在解决方案里添加windows服务,之后在Service1.cs[设计]页右键添加安装程序,在Service1.cs[代码]页的OnStart函数里编写程序启动时的代码2、在ProjectInstaller.cs设置服务启动的部分属性,如: this.serviceInstaller1.ServiceName = "SuidaoWindowsService";//
2013-04-27 16:45:30
4531
原创 获取客户端的IP地址
public static string GetIPAddress() { string user_IP = string.Empty; if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null) {
2013-03-15 16:23:57
450
原创 输出信息到日志(更新版)
private static string dirPath = System.Configuration.ConfigurationManager.AppSettings["filepath"]; //加锁 static object thisLock = new object(); public static void WritelogLoc
2013-03-01 10:52:21
229
原创 在已生成的数据表中,添加一列
public static DataSet addMc(ref DataSet ds) { ds.Tables[0].Columns.Add("sj"); foreach (DataRow row in ds.Tables[0].Rows) { row["sj"] = DateTi
2013-02-05 13:54:39
481
原创 如果每15分钟提交一次数据,则一天中应有96条数据。如有镂空,则补全没有提交的数据时间
/// /// 将DataSet个数补全至count个(日期或时间类型) /// /// 数据源 /// 要求补全的个数 /// 判断字段 /// 起始值 /// 时间类型(yyyy/MM/dd/hh/mm/ss) /// publ
2013-02-05 13:42:18
345
原创 md5加密js文件
1、js文件/* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. * Other c
2013-01-17 15:31:51
802
原创 将DataTable中的数据以Xml格式写到指定的文件内,并读取
1、写入 public void EventCodeSigns() { //创建DataTable数据表格,并填充数据。 DataTable dt = new DataTable(); dt.TableName = "huanjing"; dt.Columns.A
2012-12-08 16:28:14
546
原创 网址档案
1、安装win7系统全解http://wenku.baidu.com/view/140dc1f24693daef5ef73dad.html2、把系统做进U盘http://jingyan.baidu.com/article/19192ad85aa445e53e5707c2.html
2012-11-15 10:31:52
260
原创 JS弹出窗口
1、js代码 function openwindow(url, name, iWidth, iHeight, iscrollbars, iresizable) { var url; //转向网页的地址; var name; //网页名称,可为空; var iWidth; //弹出窗口的宽度; var iH
2012-11-14 15:07:18
240
原创 单附件上传
事件代码如下: protected void btnUp_Click(object sender, EventArgs e) { if (flu.PostedFile != null && flu.PostedFile.ContentLength > 0) { string ext = S
2012-11-14 15:01:39
269
原创 输出信息到日志
1、在web.config里定义输出日志的位置。如下: 2、输出日志的类。如下: public class WriteLog { //加锁,满足多个用户同时调用 static object thisLock = new object(); public static void Writ
2012-11-14 14:39:08
346
原创 将生成的数据导出到指定的Excel模板中
/// /// 将数据填充到指定的excel表格中 /// /// /// /// /// public void DataSetToExcel(string filepath, string fileSavePath, DataSet ds)
2012-11-14 11:18:20
511
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人