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

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. angularjs页面传参

    例如:路由配置如下: $stateProvider.state('admin.userList', { url: '/listUser?type&role',         //参数必须先在 ...

  2. 用bat使用date和time命令

    D:\>date /T 2010-12-10 星期五 D:\>echo %date:~0,10% 2010-12-10 date:命令(别忘记date后面有个冒号) ~0:从索引0开始取内 ...

  3. html,css所遇问题(一)

    html,css所遇问题(一) div中添加背景图片必须设置宽高 例如:下述代码没有设置icon的宽高值,那么网页中也不会显示出背景图片,因为div 里面有内容才会出现背景,没内容又没设置宽高,那di ...

  4. EF 实体+ Newtonsoft.Json 输出JSON 时动态忽略属性的解决方法

    最近的项目采用的是 ASP.NET mvc 4.0 + entity framework 5.0 ,后台以JSON形式抛出数据是借助于Newtonsoft.Json ,   要想忽略的属性前面添加特性 ...

  5. struts2 jsp表单提交后保留表单中输入框中的值 下拉框select与input

    原文地址:struts2 jsp表单提交后保留表单中输入框中的值 下拉框select与input jsp页面 1     function dosearch() {2         if ($(&q ...

  6. Jedis - hello world

    Maven Dependency: <dependency> <groupId>redis.clients</groupId> <artifactId> ...

  7. Wireshark - 观察 ARP 地址解析过程

    下面使用 Wireshark 分析 ARP 的工作过程.试验的机器:发送者机器(IP 地址:10.21.28.47,MAC 地址:68:f7:28:0f:32:2e)下文称为 HOSTA:目标机器(I ...

  8. xml使用系统整理

    1. 认识xml 可扩展标记语言,一种用于标记电子文档使其具有结果性的标记语言,它可以用来标记数据.定义数据类型,是一种允许用户对自己的标记语言进行定义的源语言. 2. 和超文本标记语言区别 2.1 ...

  9. winform版简易http服务器

    传人url运行(url以/结尾,例如:http://localhost:8080/web/ 监听这个url// 在浏览器 中输入 http://localhost:8080/web/?name=tes ...

  10. html保留字符详解

    本文由 www.169it.com 搜集整理 1. 注释 HTML中的注释和其它语言注释作用相似,都是为了方便阅读和调试代码.当浏览器遇到注释时会自动忽略注释内容.HTML的注释格式多行和单行注释都用 ...