C# 如何获取wopi主机集成的文件\u id?

C# 如何获取wopi主机集成的文件\u id?,c#,.net,ms-office,ms-wopi,office-online-server,C#,.net,Ms Office,Ms Wopi,Office Online Server,我已经部署了文档中提到的一个Wopi客户端,现在我正在尝试部署一个Wopi主机,但我对.net环境不熟悉,不知道如何将文件托管在Wopi docs文件夹中。(看起来是加密的,但我不知道如何获取该文件夹中的文件) 我已经完成了以下步骤: 我实现了一个office在线服务器(Wopi客户端) 我尝试了发现URL,它工作得非常好 我根据部署了一个wopi主机(顺便说一句,wopi主机和一个很棒的repo) 已在服务器中克隆repo 我从根目录中的解决方案中删除了Cobalt项目 我在根目录中找到了解决

我已经部署了文档中提到的一个Wopi客户端,现在我正在尝试部署一个Wopi主机,但我对.net环境不熟悉,不知道如何将文件托管在Wopi docs文件夹中。(看起来是加密的,但我不知道如何获取该文件夹中的文件)

我已经完成了以下步骤:

  • 我实现了一个office在线服务器(Wopi客户端)
  • 我尝试了发现URL,它工作得非常好
  • 我根据部署了一个wopi主机(顺便说一句,wopi主机和一个很棒的repo)
  • 已在服务器中克隆repo
  • 我从根目录中的解决方案中删除了Cobalt项目
  • 我在根目录中找到了解决方案
  • 我从WopiHost目录中的命令行创建WopiHost项目
  • 从WopiHost.Web目录中的命令行输入WopiHost.Web项目
  • 我试着将Wopi与a集成(我不知道它是否正确,但至少它似乎部分工作),如下所示:
  • 
    身体{
    保证金:0;
    填充:0;
    溢出:隐藏;
    -ms内容缩放:无;
    }
    #办公室框架{
    宽度:100%;
    身高:100%;
    位置:绝对位置;
    排名:0;
    左:0;
    右:0;
    底部:0;
    保证金:0;
    边界:无;
    显示:块;
    }
    var frameholder=document.getElementById('frameholder');
    var office_frame=document.createElement('iframe');
    office_frame.name='office_frame';
    office_frame.id='office_frame';
    //标题应设置为可访问性
    office_frame.title=‘office frame’;
    //此属性允许在幻灯片视图中使用真正的全屏模式
    //使用PowerPoint的“查看”操作时。
    office_frame.setAttribute('allowfullscreen','true');
    //沙盒属性需要允许自动重定向到业务用户流中的O365登录页面
    office_frame.setAttribute('sandbox','allow scripts allow home origin allow forms allow popup allow top navigation allow popup escape sandbox');
    框架支架。附属子(办公室框架);
    document.getElementById('office_form')。submit();
    
    我得到的结果是以下错误:

    是否有人知道如何获取要放入上面html文件的文件的正确名称,或者如何获取wopi主机web


    提前感谢。

    Office online server使用从WOPI主机页传递的WOPISrc查询字符串。检查WOPI主机中GetCheckFileInfo和GetFile的实现,看看它是否能够访问查询字符串中提供的文件。var file=StorageProvider.GetWopiFile(id)
    <!doctype html>
    <html>
    
    <head>
        <meta charset="utf-8">
    
        <!-- Enable IE Standards mode -->
        <meta http-equiv="x-ua-compatible" content="ie=edge">
    
        <title></title>
        <meta name="description" content="">
        <meta name="viewport"
            content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    
        <link rel="shortcut icon" href="https://my-server-url.com/wv/resources/1033/FavIcon_Word.ico" />
    
        <style type="text/css">
            body {
                margin: 0;
                padding: 0;
                overflow: hidden;
                -ms-content-zooming: none;
            }
    
            #office_frame {
                width: 100%;
                height: 100%;
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                margin: 0;
                border: none;
                display: block;
            }
        </style>
    </head>
    
    <body>
    
        <form id="office_form" name="office_form" target="office_frame" action="https://my-server-url.com/wv/wordviewerframe.aspx?ui=es-mx&rs=es-mx&dchat=1&showpagestats=1&IsLicensedUser=1&WOPISrc=http%3A%2F%2Fmy-server-url.com%3A5000%2Fwopi%2Ffiles%2Ftest.docx" method="post">
            <input name="access_token" value="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxMjM0NSIsInVuaXF1ZV9uYW1lIjoiQW5vbnltb3VzIiwiZW1haWwiOiJhbm9ueW1vdXNAZG9tYWluLnRsZCIsIlVzZXJQZXJtaXNzaW9ucyI6IlVzZXJDYW5BdHRlbmQsIFVzZXJDYW5QcmVzZW50LCBVc2VyQ2FuUmVuYW1lLCBVc2VyQ2FuV3JpdGUiLCJuYmYiOjE2MTA2MDU5NDgsImV4cCI6MTYxMDYwOTU0OCwiaWF0IjoxNjEwNjA1OTQ4fQ.KbxGcTVOa3yWCGcEHEGv9MRP_NskfViW_vyMTOupRO4" type="hidden" />
            <input name="access_token_ttl" value="0" type="hidden" />
        </form>
    
        <span id="frameholder"></span>
    
        <script type="text/javascript">
            var frameholder = document.getElementById('frameholder');
            var office_frame = document.createElement('iframe');
            office_frame.name = 'office_frame';
            office_frame.id = 'office_frame';
    
            // The title should be set for accessibility
            office_frame.title = 'Office Frame';
    
            // This attribute allows true fullscreen mode in slideshow view
            // when using PowerPoint's 'view' action.
            office_frame.setAttribute('allowfullscreen', 'true');
    
            // The sandbox attribute is needed to allow automatic redirection to the O365 sign-in page in the business user flow
            office_frame.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups allow-top-navigation allow-popups-to-escape-sandbox');
            frameholder.appendChild(office_frame);
    
            document.getElementById('office_form').submit();
        </script>
    
    </body>
    
    </html>