/----------------

using System;using System.Collections.Generic;
using System.Text;using System.Net;
namespace WarmupSharepointCS{ class Program { static void Main(string[] args) { string url = "https://www.sp.net"; string url2 = "https://www.sp.net/_windows/default.aspx?ReturnUrl="; string user = "user"; string pwd = @"pwd"; long count = ;
System.Threading.Timer t = new System.Threading.Timer(callback => { if (System.DateTime.Now.Hour >= && System.DateTime.Now.Hour < ) try { string authInfo = user + ":" + pwd; authInfo = Convert.ToBase64String(Encoding.UTF8.GetBytes(authInfo)); var webclient = new WebClient2(); webclient.Headers[HttpRequestHeader.Authorization] = "Basic " + authInfo; var webpage = webclient.DownloadString(url2);
var str2 = webclient.DownloadString(url);
Console.ForegroundColor = System.ConsoleColor.Green; Console.WriteLine(webpage); } catch (Exception ex) { Console.ForegroundColor = System.ConsoleColor.Red; Console.WriteLine(ex.Message); } count++; Console.WriteLine("timer:" + count.ToString()); },null,,* * );
Console.Read();
} }} //---------------- /////////////////////////////// using System;using System.Collections.Generic; using System.Net;
namespace WarmupSharepointCS{ public class WebClient2:System.Net.WebClient {
private readonly CookieContainer m_container = new CookieContainer();
protected override WebRequest GetWebRequest(Uri address) { WebRequest request = base.GetWebRequest(address); HttpWebRequest webRequest = request as HttpWebRequest; if (webRequest != null) { webRequest.CookieContainer = m_container; } return request; }
}} //////////////////////////////////

sharepoint warmup的更多相关文章

  1. 如何对SharePoint网站进行预热(warmup)以提高响应速度

    问题描述 SharePoint Server是一个易于使用的协作平台,目前在越来越多的企业中被应用开来.SharePoint Server是通过网站的形式向最终用户提供服务的,而这个网站是基于ASP. ...

  2. BPM SharePoint解决方案分享

    一.需求分析 SharePoint作为微软推出的协同类平台产品,为客户提供了门户.内容.文档.流程.社区.搜索.BI等一系列的解决方案,然而其流程功能由于设计理念差异,不能完全满足客户的需求,主要原因 ...

  3. Visual Studio 2013 添加一般应用程序(.ashx)文件到SharePoint项目

    默认,在用vs2013开发SharePoint项目时,vs没有提供一般应用程序(.ashx)的项目模板,本文解决此问题. 以管理员身份启动vs2013,创建一个"SharePoint 201 ...

  4. 在 SharePoint Server 2016 本地环境中设置 OneDrive for Business

    建议补丁 建议在sharepoint2016打上KB3127940补丁,补丁下载地址 https://support.microsoft.com/zh-cn/kb/3127940 当然不打,也可以用O ...

  5. SharePoint 2016 入门视频教程

    之前一直有朋友让自己录一些SharePoint的入门视频,之前没有太多时间,一个巧合的机会收到CSDN学院的邮件,可以在CSDN上发布视频教程,自己就录了一些.说起录视频也是蛮辛苦的,每天下班吃完饭要 ...

  6. 如何使用本地账户"完整"安装 SharePoint Server 2010+解决“New-SPConfigurationDatabase : 无法连接到 SharePoint_Config 的 SQL Server 的数据 库 master。此数据库可能不存在,或当前用户没有连接权限。”

    注:目前看到的解决本地账户完整安装SharePoint Server 2010的解决方案如下,但是,有但是的哦: 当我们选择了"完整"模式安装SharePointServer201 ...

  7. SharePoint 2016 必备组件离线安装介绍

    前言 SharePoint 必备组件安装,一直以来都是SharePoint安装过程中的最大的坑,尤其是不能联网的服务器.博主在这里简单介绍一下离线安装过程,并附组件包下载以及安装命令,并且在windo ...

  8. SharePoint 2013 create workflow by SharePoint Designer 2013

    这篇文章主要基于上一篇http://www.cnblogs.com/qindy/p/6242714.html的基础上,create a sample workflow by SharePoint De ...

  9. Install and Configure SharePoint 2013 Workflow

    这篇文章主要briefly introduce the Install and configure SharePoint 2013 Workflow. Microsoft 推出了新的Workflow ...

随机推荐

  1. 程氏CMS去掉静态页面的隐藏性版权方法

    程氏CMS去掉静态页面的隐藏性版权方法 实例如图: 因为之前自己找了好久都没找到这俩代码写在那个文件夹的,经过跟csqq8讨论了也没有得到结果,今天突然发现,原来这些代码都经过base64加密,用加密 ...

  2. Wince 文本函数和字体应用

    好像又进入了一个疲惫期了,晚上状态不好,但是还是想继续更新下博客,继上次分析了wince下设备环境以及怎么绘制相关图像后,,笔者在这片文章中讲到文本函数以及其相关应用.文本输出函数是输出文本的内容,也 ...

  3. truncate 函数用法示例

    --Oracle trunc()函数的用法 /**************日期********************/ select trunc(sysdate) from dual --2015- ...

  4. asp.net 文件压缩zip下载

     今天分享下昨天做的一个东西 asp.net 的文件  zip 批量下载,首先你需要去 到http://dotnetzip.codeplex.com这个站点下载zip 的包,在里面找到 Ionic.Z ...

  5. Windows中使用cmd实现自定义Service的安装与卸载

    在项目中,有些时候我们需要自定义一些Service来定时处理一些业务逻辑,这时候就涉及到如何安装与卸载service的问题了,具体如何安装呢?在此整理一些解决方案供大家参考: 方案一: 1.运行--〉 ...

  6. (原创)monitor Dell Powerconnec 6224 with cacti

    使用cacti监控DELL Powerconnect 6224,可以直接使用http://docs.cacti.net/usertemplate:host:dell:powerconnect:62xx ...

  7. Java Concurrency - ReentrantLock

    ReentrantLock 是可重入的互斥锁,它具有与使用 synchronized 方法和语句所访问的隐式监视器锁相同的一些基本行为和语义,但功能更强大. ReentrantLock 将由最近成功获 ...

  8. MVC中提示错误:从客户端中检测到有潜在危险的 Request.Form 值的详细解决方法

    今天往MVC中加入了一个富文本编辑框,在提交信息的时候报了如下的错误:从客户端(Content="<EM ><STRONG ><U >这是测试这...&q ...

  9. SQL server经典电子书、工具和视频教程汇总

    SQL server经典电子书.工具和视频教程汇总 SQL server经典电子书.工具和视频教程汇总 SQL Server是高校计算机专业的一门必修课程,同时众多企业采用SQL Server作为数据 ...

  10. Commons-logging + Log4j

    一.Commons-logging能帮我们做什么? 1.提供一个统一的日志接口,简单了操作,同时避免项目与某个日志实现系统紧密耦合 2.自动选择适当的日志实现系统 a.classpath下查找comm ...