从网页自动打开Excel [英] Open Excel automatically from a Webpage
问题描述
我正在寻找功能,如果您按下网页内的按钮或链接,它将自动在您的本地计算机上打开Excel。您按下的按钮或链接是使用特定数据定义的,例如数据"test"。并且你想要
在按下按钮或链接后将数据包含在excel中的内容
请记住你在网页上有数据然后当您按下按钮或链接时自动打开Excel文档,来自wepage的数据将自动转换为excel文档。
是否可以做到了吗?如果是,怎么样?
b $ b b
我尝试使用源代码找到解决方案但是我失败了。
I'm looking fora functionality that if you press a button or a link inside of a webpage, it will automatically open excel in you local computer. The button or link that you press is defined with specific data for instance data "test" and you want
to have the data inside of the excel after you have pressed the button or link
Please remember that you have the data in the webpage and then when you press on the button or link you open the excel document automatically and the data from the wepage will be transered automatically to the excel document.
Is it possible to do it? if yes, how?
I have tried finding a solution by using sourcecode but I failed.
这个上下文是关于前端。
This context is about frontend.
谢谢!
推荐答案
这不是Asp.NET论坛而是C#。您可以在这里询问Asp.NET相关问题:
This is not Asp.NET forum but C#. You can ask Asp.NET related question on here:
但是,您可以这样做:
- 将按钮连接到控制器内的方法
- 在该控制器中添加以下行:
System.Diagnostics.Process.Start("http://www.youradress.com/yourFile.xls");
通过这种方式,当按钮点击时,excel文件打开。但是,我还没有对它进行测试,如果用户想要打开文件,可能会在用户端出现安全警告。
By that way, when button clicks, excel file opens. However, I have not tested it and there can be a security warning on the user side if he wants to open the file or not.
这篇关于从网页自动打开Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!