发布网站后,是否可以使用system.diagnostics process.start打开txt图块? [英] is it possible to open a txt tile using system.diagnostics process.start after publish a website?

查看:78
本文介绍了发布网站后,是否可以使用system.diagnostics process.start打开txt图块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在发布网站后使system.diagnostics process.start开始工作?

How to make work system.diagnostics process.start after publish a website?

推荐答案

您不能.

正如我在两个小时前所说的那样:这将在服务器而非客户端上打开记事本.您不能在客户端计算机上运行程序,这就是要防止病毒扫描程序和防火墙的原因.
如果需要向用户显示文本文件,则必须打开自己的页面并在其中显示文本文件的内容.
You can''t.

As I said two hours ago: That will open notepad at the server, not the client. You cannot run programs on client machines, that is what virus scanners and firewalls are there to prevent.

If you need to show a text file to your user, then you will have to open a page of your own and display the text file content in that.


如Originalariff在此线程 [发布前,它在您的计算机上运行,​​因此在您启动该过程时,它对您是可见的.发布后,它可以在远程计算机上运行!

相反,您需要做的是从文本文件中读取输入,然后将其显示在您站点的页面上
As mentioned by OriginalGriff in this thread[^], what you are trying to do will cause the text file to open on the server (if allowed) in notepad.

This won''t be visible by you, how could it be?

You say ''This is working fine before publish the website'', but think about it. Before publish, it''s running on your machine so when you start the process it''s visible to you. After publish, its running on a remote machine!

Instead, what you need to do is read the input from the text file, then display it on a page in your site


这篇关于发布网站后,是否可以使用system.diagnostics process.start打开txt图块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆