对,没错,如果你按关键字找到这篇随笔了,相信一定知道背景,以及我所说的是什么。

上一段子代码。

private void timerHideButton_Tick(object sender, EventArgs e)
{
try
{
HtmlDocument htmlDoc = webBrowser.Document;
if (webBrowser.Document != null)
htmlDoc = webBrowser.Document.Window.Frames["wacframe"].Document;
if (htmlDoc == null)
return; var toolBar = htmlDoc.GetElementById("PptUpperToolbar.LeftButtonDock");    //PPT、PPTX
if (toolBar == null)      
toolBar = htmlDoc.GetElementById("stripLeft");                 //DOC、DOCX、PDF
if (toolBar == null)
toolBar = htmlDoc.GetElementById("m_excelWebRenderer_ewaCtl_stripLeft"); //XLS、XLSX if (toolBar != null)
{
toolBar.InnerHtml = "";
timerHideButton.Enabled = false;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}

  张三问了:还用个Timer,不科学,你应该把代码放到
                         webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e);

回答:原先我也是这么想的,但是、可是因为 iframe 的原因,Completed事件可能会被激活多次,并且直到最后一次也不能准确得到预期结果。

(原)用WebBrowser浏览Office Web Apps Server,除去“下载”按钮的更多相关文章

  1. Office Web Apps Server

    Office Web Apps Server Office Web Apps Server 是一款 Office 服务器产品,可提供针对 Office 文件的基于浏览器的文件查看和编辑服务.Offic ...

  2. Office Web Apps Server 2013与PDF(一)

    好吧--这个消息有点旧,迟了将近4个月. Office Web Apps是微软各大服务产品系列中的一个基础服务,可以为SharePoint 2013.Exchange 2013.Lync 2013提供 ...

  3. sharepoint 2013 和 office web apps server 2013集成

    环境: 三台服务器  系统:window 2008 R2server01: 192.168.10.162(office web app)server02: 192.168.10.163(AD)serv ...

  4. Office Web Apps Server 概述

    Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.PowerPoint.Excel 和 OneNote 的基于浏览器的版本.单个 Office Web ...

  5. [转载]部署Office Web Apps Server并配置其与SharePoint 2013的集成

    Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.PowerPoint.Excel 和 OneNote 的基于浏览器的版本.单个 Office Web ...

  6. 部署Office Web Apps Server并配置其与SharePoint 2013的集成

    部署Office Web Apps Server并配置其与SharePoint 2013的集成   Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.P ...

  7. office web apps server 问题和解决办法

    New-OfficeWebAppsFarm –InternalURL "http://owa.zjkhlib.com" –AllowHttp –EditingEnabled 错误1 ...

  8. office web apps server安装部署

    操作系统:windows 2012 软件下载地址: 链接:https://pan.baidu.com/s/1c3WWFs8 密码:4dcy NDP452-KB2901954-Web.exe(.Net ...

  9. BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 WOPI和新的Office Web Apps Server

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序  WOPI和新的Office Web Apps Server ...

随机推荐

  1. Linux查看使用端口的进程

    netstat –apn | grep 8080 lsof -i:8080

  2. Bootstrap入门八:图片

    1.响应式图片 在 Bootstrap 版本 3 中,通过为图片添加 .img-responsive 类可以让图片支持响应式布局.其实质是为图片设置了 max-width: 100%;. height ...

  3. linux通过c++实现线程池类

    目录 线程池的实现 线程池已基于C++11重写 : 基于C++11实现线程池的工作原理 前言 线程池的概念 使用原因及适用场合 线程池的实现原理 程序测试 线程池的实现 线程池已基于C++11重写 : ...

  4. Gumbel-Softmax Trick和Gumbel分布

      之前看MADDPG论文的时候,作者提到在离散的信息交流环境中,使用了Gumbel-Softmax estimator.于是去搜了一下,发现该技巧应用甚广,如深度学习中的各种GAN.强化学习中的A2 ...

  5. Django基础-Lesson1

    web框架概念 框架,即framework,特指为解决一个开放性问题而设计的具有一定约束性的支撑结构,使用框架可以帮你快速开发特定的系统. 对于所有的Web应用,本质上其实就是一个socket服务端, ...

  6. linux文件删除,剩余空间没变化

    centOS6.6,删除了一个13G的文件,但是使用df -h 查看,剩余空间没变化这个文件夹查看 du -h查看发现空间已经变少了.原因可能是删除文件时有进程在使用文件,导致空间未释放.yum in ...

  7. 排序算法之直接插入排序Java实现

    排序算法之直接插入排序 舞蹈演示排序: 冒泡排序: http://t.cn/hrf58M 希尔排序:http://t.cn/hrosvb  选择排序:http://t.cn/hros6e  插入排序: ...

  8. BZOJ.4552.[HEOI2016/TJOI2016]排序(线段树合并/二分 线段树)

    题目链接 对于序列上每一段连续区间的数我们都可以动态开点建一棵值域线段树.初始时就是\(n\)棵. 对于每次操作,我们可以将\([l,r]\)的数分别从之前它所属的若干段区间中分离出来,合并. 对于升 ...

  9. Java混剪音频

    分享一个之前看过的程序,可以用来剪辑特定长度的音频,将它们混剪在一起,思路如下: 1.使用 FileInputStream 输入两个音频 2.使用 FileInputStream的skip(long ...

  10. 批量将Java源代码文件的编码从GBK转为UTF-8

    主要参考: http://blog.csdn.net/liu_qiqi/article/details/38706497 使用common io批量将java编码从GBK转UTF-8 http://w ...