如何打开ms项目xml文件

发布于 2024-12-26 03:23:13 字数 364 浏览 3 评论 0原文

当我单击 ASP.Net 中的 xml 文件时,如何立即在 MS Office Project 中打开文件。 现在打开默认的 xml 编辑器。

下载xml文件的代码是

Response.ContentType = "application/vnd.ms-project";
Response.AppendHeader("Content-Disposition", "attachment; filename=file.xml");

UPDATE 我的网页上有一个按钮。当用户单击按钮时,开始下载 xml 格式的 ms 项目文件。 我需要这样做,当用户在浏览器下载对话框中选择“打开文件”时,文件会在 MS Project 中打开

How to immediately open file in MS Office Project when I click a xml file in ASP.Net.
Now open default xml editor.

The code of downloading xml file is

Response.ContentType = "application/vnd.ms-project";
Response.AppendHeader("Content-Disposition", "attachment; filename=file.xml");

UPDATE
There is a button on my web page. When user click on button begins downloading ms project file in xml format.
I need to do that when user choose "open file" in browser download dialog, file opens in MS Project

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一笑百媚生 2025-01-02 03:23:13

通过使用指定了 attachmentContent-Disposition,您可以告诉浏览器只执行当前正在发生的事情;该文件被视为下载名为 file.xml 的文件。

如果您不想下载该文件,请尝试完全删除该标头。请注意,仍然不能保证浏览器能够打开 Project,因为它取决于浏览器配置以及用户计算机上安装的内容。

如果您确实希望下载文件,但为了让浏览器在下载后在 Project 中打开它,则需要将 filename 标头值中的文件扩展名更改为 Microsoft Project 的正确文件扩展名。

By using Content-Disposition with attachment specified, you are telling the browser to do just what is currently happening; the file is treated like a download of a file called file.xml.

If you don't want the file to be downloaded, try removing that header altogether. Note that it is still not guaranteed that the browser will be able to open Project since it depends on browser configuration and what is installed on the user's computer.

If you do want the file downloaded but for the browser to open it in Project after it's downloaded, you need to change the file extension in your filename header value to the correct file extension for Microsoft Project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文