对Enum的循环处理
摘要:foreach (int temp in Enum.GetValues(typeof(Enumtest))){ //insert code here}
阅读全文
posted @
2012-06-30 10:36
西湖浪子
阅读(283)
推荐(0)
计划任务
摘要:(转)在业务复杂的应用程序中,有时候会要求一个或者多个任务在一定的时间或者一定的时间间隔内计划进行,比如定时备份或同步数据库,定时发送电子邮件等,我们 称之为计划任务。实现计划任务的方法也有很多,可以采用SQLAgent执行存储过程来实现,也可以采用Windows任务调度程序来实现,也可以使用 Windows服务来完成我们的计划任务,这些方法都是很好的解决方案。但是,对于Web应用程序来说,这些方法实现起来并不是很简单的,主机服务提供商 或者不能直接提供这样的服务,或者需要你支付许多额外的费用。 本文就介绍一个直接在Web应用程序中使用的简单的方法,这个方法不需要任何额外的配置即可轻松实现。
阅读全文
posted @
2012-04-24 17:25
西湖浪子
阅读(371)
推荐(0)
计划任务的编成实现
摘要:在一些需要定时执行的任务时,比如:定时备份数据库,定时的获取网络数据等都需要计划任务。Window也有计划任务但是有很多的缺点,必须手动配置,而且部署起来也很麻烦,时间的精度为一分钟,只能对应用程序配置任务。这里实现的任务计划是可以自己编程,可以很灵活,时间的精度为一秒,而且不是通过轮询时间实现的,效率比较高,。你可以在Windows 服务中写一个服务,用它来管理所有的计划任务逻辑。 类库源代码如下: /**//********************************************************************************************
阅读全文
posted @
2012-04-24 16:05
西湖浪子
阅读(373)
推荐(0)
C# 用TaskScheduler.dll 创建 windows任务计划 (转)
摘要:在codeproject中有一个开源项目 可以使用C#调用 来创建windows的计划任务。地址为: http://www.codeproject.com/KB/cs/tsnewlib.aspx上代码:Scheduler sched = new Scheduler(); foreach (Task t in sched.Tasks){ Console.WriteLine(t.ToString()); foreach (Trigger tr in t.Triggers) Console.WriteLine(tr.ToString());}// Set only trigger on an exi
阅读全文
posted @
2012-04-24 15:50
西湖浪子
阅读(2571)
推荐(0)
FTPClient 通过二进制类型、ASCII类型 传输
摘要:using System;using System.Net;using System.IO;using System.Text;using System.Net.Sockets;namespace WindowsApplication1.Bll{ /// <summary> /// FTPClient 的摘要说明。 /// </summary> public class FTPClient { #region 构造函数 /// <summary> /// 缺省构造函数 /// </summary> public FTPClient() { str
阅读全文
posted @
2012-04-24 12:57
西湖浪子
阅读(4193)
推荐(0)
Winform调用系统的剪切,复制,粘贴文件功能
摘要:转载做一个小软件,类似于资源管理器的操作形式,剪切,复制,粘贴自然是少不了的了,在MSDN中找来好久,总算是明白过来了,代码如下: /// <summary> /// 复制或剪切文件至剪贴板(方法) /// </summary> /// <param name="files">需要添加到剪切板的文件路径数组</param> /// <param name="cut">是否剪切true为剪切,false为复制</param> public static void CopyToClipb
阅读全文
posted @
2012-03-24 17:11
西湖浪子
阅读(2013)
推荐(0)
C#通用类库--DOS常用命令
摘要://类名:EcanDOS//作用:DOS常用命令操作//作者:刘典武//时间:2010-12-01using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Diagnostics;using System.Runtime.InteropServices;namespace Ecan{ public class EcanDOS { //引入API函数 [DllImportAttribute("user32.dll")] private static
阅读全文
posted @
2012-03-24 14:58
西湖浪子
阅读(200)
推荐(0)
Google Analytics(分析)跟踪代码:电子商务
摘要:http://code.google.com/intl/zh-CN/apis/analytics/docs/gaJS/gaJSApiEcommerce.html跟踪代码:电子商务 注意:本参考文档描述的是可用于在 Google Analytics(分析)报告中设置电子商务跟踪的各种方法。有关设置电子商务跟踪的更多信息,请参阅电子商务跟踪。GATC 电子商务方法_addItem(orderId, sku, name, category, price, quantity)_addTrans(orderId, affiliation, total, tax, shipping, city, stat
阅读全文
posted @
2012-02-16 15:15
西湖浪子
阅读(1387)
推荐(0)
MicrosoftAjaxWebForms.js
摘要://----------------------------------------------------------// Copyright (C) Microsoft Corporation. All rights reserved.//----------------------------------------------------------// MicrosoftAjaxWebForms.jsType.registerNamespace("Sys.WebForms");Sys.WebForms.BeginRequestEventArgs = functio
阅读全文
posted @
2011-12-22 10:50
西湖浪子
阅读(789)
推荐(0)
转 Asp.net Ajax ASP.NET 局部更新PostBack的客户端调用过程
摘要:<script type="text/javascript">Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('form1'));Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tUpdatePanel1'], [], [], 90);</script> 看一下MicrosoftAjaxWebForms
阅读全文
posted @
2011-12-21 17:56
西湖浪子
阅读(458)
推荐(0)
判断局部临时表是否存在,如果存在就删除它
摘要:create table #t(id int) if exists(select 1 from tempdb..sysobjects where left(name,len( '#t '))= '#t ') begin print '存在 ' drop table #t end else print '不存在 ' if exists(select 1 from tempdb..sysobjects where left(name,len( '#t '))= '#t ') print '存在
阅读全文
posted @
2011-12-14 13:43
西湖浪子
阅读(155)
推荐(0)
svn版本信息的删除
摘要:问题:从公司svn下,检出代码,包含svn信息,它是可以同步的包括很多的svn信息。但是我要这些代码只是看看,并在利用它在本地svn服务器上,且往往包含这些svn版本信息的文件占空间,拷贝速度慢。 解决: 1、在公司svn上再 导出一份 导出和检出是不同的,导出不包含版本信息,检出则包含版本信息 2、因为代码比较多,有2G多,导出比较慢 本地拷贝一份含svn版本信息的文件,想办法删除所有版本信息。 最简单的方法是,搜索所有.svn文件,然后删除。 查了哈网上的,有三个方法如下: 一、在linux下 删除这些目录是很简单的,命令如下 find . -type d -name ".svn
阅读全文
posted @
2011-09-23 11:27
西湖浪子
阅读(178)
推荐(0)
异步图片资源
摘要://<img xxxxsrc="XXXX.jpg">(function(e) { Snda = e.Snda = e.Snda || {}; Snda.extend = function(a, b, c) { for (prop in b) { if (c == false && a[prop] != null) continue; a[prop] = b[prop] }; return a }; Snda.Utility = Snda.Utility || {}; Snda.Utility.Event = Snda.Utility.Event
阅读全文
posted @
2011-09-09 16:57
西湖浪子
阅读(206)
推荐(0)
动态拉去的数据
摘要:动态拉去的数据:<ul><li><a href="/info/4377_0.html" target="_blank" tabIndex="-1"><font color="red">教您识别常见网络骗术</font></a></li><li><a href="#" onclick="pgvSendClick({hottag:'KF.SERVICE.INDEX.ANNOUNCE
阅读全文
posted @
2011-08-13 14:55
西湖浪子
阅读(189)
推荐(0)
js 中文编码 工具
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-
阅读全文
posted @
2011-08-06 21:41
西湖浪子
阅读(199)
推荐(0)
中国省份与城市数据插入 .
摘要:if exists (select * from sysobjects where id = OBJECT_ID('[province]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE [province]CREATE TABLE [province] ([id] [int] NOT NULL,[provinceID] [nvarchar] (12) NOT NULL,[province] [nvarchar] (80) NOT NULL)ALTER TABLE [province] WITH NO
阅读全文
posted @
2011-08-06 19:10
西湖浪子
阅读(210)
推荐(0)
网页定时信息提醒
摘要:<div id="popup" style="display:none" class="pay_attention layoutfix"><a href="javascript:void(0);" onclick="this.parentNode.style.display='none';" title="关闭" class="close_attention"></a><div class=&quo
阅读全文
posted @
2011-08-05 10:08
西湖浪子
阅读(225)
推荐(0)
ASP.NET中使用System.Net.Mail发邮件
摘要:一、一般的邮件发送public static void SendMail()//普通的邮件发送{ MailAddress from = new MailAddress("FromEmail@website.com"); MailAddress to = new MailAddress("ToEmail@website.com"); MailMessage message = new MailMessage(from, to); message.Subject = "邮件标题"; message.Body = "邮件内容&qu
阅读全文
posted @
2011-07-11 17:15
西湖浪子
阅读(358)
推荐(0)
判断操作系统版本
摘要:If (Environment.OSVersion.Platform <> PlatformID.Win32NT) Then Throw New PlatformNotSupportedException(SR.GetString("RequiresNT")) End If If ((Environment.OSVersion.Version.Major >= 7) OrElse ((Environment.OSVersion.Version.Major = 6) AndAlso (Environment.OSVersion.Version.Minor &
阅读全文
posted @
2011-07-11 15:36
西湖浪子
阅读(193)
推荐(0)
一个C#获得桌面窗口的例子 .
摘要:一个网上的例子c# 获取鼠标处窗口句柄,程序嵌入桌面using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace WindowsApplication1{ public partial class Form1 : Form { public Form1
阅读全文
posted @
2011-07-04 16:37
西湖浪子
阅读(711)
推荐(0)