当前位置: 首页 > news >正文

无锡企业网站制作报价中装建设集团股份有限公司

无锡企业网站制作报价,中装建设集团股份有限公司,建站公司 网络服务,美食网页设计作品首先介绍一下什么是定时器作业#xff0c;说的再多#xff0c;也不如一张图说的清楚这两张图应该把我想说的已经表达清楚了#xff0c;下一步介绍一下如何自定义Timer Job第一步#xff1a;创建一个类#xff08;CustomTimerJob.cs#xff09;第二步#xff1a;引用 usi…首先介绍一下什么是定时器作业说的再多也不如一张图说的清楚这两张图应该把我想说的已经表达清楚了下一步介绍一下如何自定义Timer Job第一步创建一个类CustomTimerJob.cs第二步引用 using Microsoft.SharePoint.Administration;并继承SPJobDefinition第三步构造 三个函数        public CustomTimerJob()            : base()        {        }        public CustomTimerJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)            : base(jobName, service, server, targetType)        {        }        public CustomTimerJob(string jobName, SPWebApplication webApplication)            : base(jobName, webApplication, null, SPJobLockType.ContentDatabase)        {            this.Title Custom Timer Job;  //在上面的图处上可以看到这个名字        }第四步override Execute 处理自己的业务     public override void Execute(Guid targetInstanceId)        {            SPWebApplication webApplication this.Parent as SPWebApplication;            SPContentDatabase contentDb webApplication.ContentDatabases[targetInstanceId];            // get a reference to the Tasks list in the RootWeb of the first site collection in the content database            SPList taskList contentDb.Sites[0].RootWeb.Lists[Product];            // create a new task, set the Title to the current day/time, and update the item            SPListItem newTask taskList.Items.Add();            newTask[Title] DateTime.Now.ToString();            newTask.Update();        }在上一篇 自定义 Features 里面当激活功能时到管理中心可以看到自己的定义的 Timer Jobpublic override void FeatureActivated(SPFeatureReceiverProperties properties)        {            SPSite site properties.Feature.Parent as SPSite;            if (site ! null)            {                foreach (SPJobDefinition job in site.WebApplication.JobDefinitions)                {                    if (job.Name CUSTOM_TIMER_JOB)                    {                        job.Delete();                    }                }            }            //开始Job            CustomTimerJob customTimerJob new CustomTimerJob(CUSTOM_TIMER_JOB, site.WebApplication);            SPMinuteSchedule schedule new SPMinuteSchedule();            schedule.BeginSecond 0;            schedule.EndSecond 59;            schedule.Interval 5;            customTimerJob.Schedule schedule;            customTimerJob.Update();        }之后部署到网站网站集里停止再激活之后去管理中心就可以看到自己定义的Job了更多精彩请关注转载于:https://www.cnblogs.com/Fengger/archive/2012/06/02/2532047.html
http://www.pierceye.com/news/60814/

相关文章:

  • 网站与网页区别网站开发技术问题
  • 网站不被百度收录视觉中国网站
  • 昆明网站建设平台烟台网站排名系统
  • 延庆宜昌网站建设去哪找wordpress主题
  • 帝国cms建站实例教程山东泰安网络科技有限公司
  • 北京网站设计公司yx成都柚米科技15惠州抖音seo策划
  • 手机网站开发怎么样怎么查域名有没有备案
  • 合肥建站方案wordpress 媒体 路径
  • 惠州微网站建设网页设计代码模板代码
  • 无锡网站建设培训班帮别人做网站制作
  • 做网站如果被忽悠了咋办成都工装公司
  • 网站建设的心得餐饮型网站开发
  • 那个网站ppt做的比较好做简约头像网站
  • 网站更换域名需要重新备案吗店铺推广怎么做
  • 佟年给韩商言做的网站徐州网
  • 网络营销方式的类型有网站首页关键词如何优化
  • 资深网页设计师0经验培训深圳网站做优化哪家公司好
  • 小装修网站开发费用淘宝联盟怎么推广
  • asp网站管理系统源码做网站常用什么软件
  • 制作小动画的软件win7一键优化工具
  • 深圳做网站设计制作开发猎头用什么网站做单
  • 网页游戏排行榜2016大连百度搜索排名优化
  • app 网站网站安全设置教程
  • 企业怎么做自己的网站小程序外包公司出名
  • 连云港做网站设计网站开发的发展的前景
  • 公司网站建网云服务器租赁
  • 国内大型餐饮网站建设罗湖区网站公司
  • 洛阳网站建设首选洛阳铭信科技网站开发业务好做吗
  • 做婚恋网站怎么样wordpress 删除菜单
  • 如何做旅游网站企业文化包括哪些内容