(原)用WebBrowser浏览Office Web Apps Server,除去“下载”按钮
对,没错,如果你按关键字找到这篇随笔了,相信一定知道背景,以及我所说的是什么。
上一段子代码。
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,除去“下载”按钮的更多相关文章
- Office Web Apps Server
Office Web Apps Server Office Web Apps Server 是一款 Office 服务器产品,可提供针对 Office 文件的基于浏览器的文件查看和编辑服务.Offic ...
- Office Web Apps Server 2013与PDF(一)
好吧--这个消息有点旧,迟了将近4个月. Office Web Apps是微软各大服务产品系列中的一个基础服务,可以为SharePoint 2013.Exchange 2013.Lync 2013提供 ...
- sharepoint 2013 和 office web apps server 2013集成
环境: 三台服务器 系统:window 2008 R2server01: 192.168.10.162(office web app)server02: 192.168.10.163(AD)serv ...
- Office Web Apps Server 概述
Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.PowerPoint.Excel 和 OneNote 的基于浏览器的版本.单个 Office Web ...
- [转载]部署Office Web Apps Server并配置其与SharePoint 2013的集成
Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.PowerPoint.Excel 和 OneNote 的基于浏览器的版本.单个 Office Web ...
- 部署Office Web Apps Server并配置其与SharePoint 2013的集成
部署Office Web Apps Server并配置其与SharePoint 2013的集成 Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.P ...
- office web apps server 问题和解决办法
New-OfficeWebAppsFarm –InternalURL "http://owa.zjkhlib.com" –AllowHttp –EditingEnabled 错误1 ...
- office web apps server安装部署
操作系统:windows 2012 软件下载地址: 链接:https://pan.baidu.com/s/1c3WWFs8 密码:4dcy NDP452-KB2901954-Web.exe(.Net ...
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 WOPI和新的Office Web Apps Server
BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 WOPI和新的Office Web Apps Server ...
随机推荐
- 1975: [Sdoi2010]魔法猪学院
k短路,只会写A*的飘过..priority_queue超空间差评!
- 【LOJ】#2037. 「SHOI2015」脑洞治疗仪
题解 维护区间内1的个数,左边数0的长度,右边数0的长度,区间内0区间最长个数,覆盖标记 第一种操作区间覆盖0 第二种操作查询\([l_0,r_0]\)中1的个数,区间覆盖0,然后覆盖时找到相对应的区 ...
- MySQL 大数据量使用limit分页,随着页码的增大,查询效率越低下。
数据表结构 CREATE TABLE `ad_keyword` ( `id` int(11) NOT NULL AUTO_INCREMENT, `plan_goods_id` int(11) DEFA ...
- vue 父子间组件传值
1.父组件向子组件传值: 实例截图: 实例代码: /*子组件代码*/ //child.vue <template> <div style="border: 1px soli ...
- Docker应用系列(六)| 如何去掉sudo及避免权限问题
一.如何在使用docker时去掉sudo 1.添加账户 $ sudo groupadd docker 2.授权给docker账户 sudo gpasswd -a yourname docker 3.重 ...
- 获取类的属性并排除特定属性(getType().GetProperties())
当获取一个类型(class)的所有属性时,想排除指定属性,该如何操作? 比如:EF中一个实体类型UserEntity,通过反射获取这个类的属性时,想排除这个为映射的字段ID 使用以下方法即可! Pro ...
- hdu1527下沙小面的(二)
B - 下沙小面的(2) Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit ...
- [BZOJ4569][SCOI2016]萌萌哒(倍增+并查集)
首先有一个显然的$O(n^2)$暴力做法,将每个位置看成点,然后将所有限制相等的数之间用并查集合并,最后答案就是9*(10^连通块的个数).(特判n=1时就是10). 然后比较容易想到的是,由于每次合 ...
- 问题记录:未设置为接受端口“文件和打印机共享(SMB)”上的连接
解决办法: 网络(右击)——属性——本地连接(右击)——属性——此连接使用下列选项——Microsoft网络的文和打印共享(打上勾)
- Problem A: 象棋比赛
Description 1月6日,教职工象棋协会在6号楼办了一次比赛,很多老师都参加了.比赛共进行了5轮,赢1局积3分,和了1分,输了0分,你能帮忙算一下各位老师的积分吗? Input 多组测试数据, ...