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

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. hdu 4340 树状DP

    思路:我们定义两个数组,ant[Maxn][2],bob[Maxn][2].ant[i][0]表示还未确定哪个城市被全费用占领,ant[i][1]表示确定了哪个城市被全费用占领.那么ant[i][0] ...

  2. 将CSV格式的文件导入到数据中

    --创建表 create table t1( id number primary key, name ), score number, subject ) ) --创建控制文件 t1.ctl,以文本的 ...

  3. 减小iOS应用程序的大小

    减小iOS应用程序的大小 本文译自:Reducing the size of my App Q: 怎样才能让我的程序安装包小一点,让程序的下载和安装更快速? A: 本文收集了一些减小程序安装包大小的相 ...

  4. EasyUI的datagrid获取所有正在编辑状态的行的行编号

    今天项目需要用了下EasyUI的datagrid的行编辑功能,跟着API来,只要是将各种状态时的处理逻辑弄好,还是蛮不错的. 开发过程中,遇到了个问题,在编辑完成后我需要获取datagrid所有处于编 ...

  5. 初探html5---Video + DOM(视频播放)

    1:HTML5 开发环境下  lang="en" 2: <video width="320" height="240" control ...

  6. 每天一道LeetCode--119.Pascal's Triangle II(杨辉三角)

    Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3, ...

  7. UML——类和对象

  8. windows下cmd命令行显示UTF8字符设置(CHCP命令)

    本文由 www.169it.com 收集整理 在中文Windows系统中,如果一个文本文件是UTF-8编码的,那么在CMD.exe命令行窗口(所谓的DOS窗口)中不能正确显示文件中的内容.在默认情况下 ...

  9. ios 一个app启动另一个app

    问题描述:需要从一个ios应用程序中,能启动另一个ios应用程序. 开发环境:xcode7.3.1 关键词:白名单(LSApplicationQueriesSchemes).注册自己的URL Demo ...

  10. block的动态传值例子

    /*  写一个block传值  ,让两个数进行相除和相乘,在运行时动态决定采用哪种计算方式 */ #import <Foundation/Foundation.h> int main(in ...