如何使用Spotfire Webplayer中的ironPython脚本打开Windows资源管理器

时间:2019-09-04 15:07:45

标签: ironpython explorer spotfire-webplayer

我使用下面的IronPython脚本打开Windows资源管理器,以找到一个在客户端Spotfire中完美运行的定义路径。

当我在Spotfire Webplayer 中运行相同的脚本时,Windows资源管理器不会打开。

没有显示错误消息,但我在底部工具栏中看到以下信息:Javascript:void(0);

# This script executes an external program. 

#Script Parameters
program = 'explorer.exe'
url = 'file://U:/Data/Downloads/'

#A. We need the Process class to execute external programs
from System.Diagnostics import Process

#B. Create new process instance
p = Process()

#B.1 Configure your process
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.FileName = program
p.StartInfo.Arguments = url

#C. Start the process and wait 
p.Start()
p.WaitForExit()

如何更新脚本以使其也可以在Spotfire Webplayer中使用。

1 个答案:

答案 0 :(得分:1)

在Spotfire网络播放器上,脚本在服务器上运行。当您创建执行程序的过程时,将在服务器上创建该过程。这就是为什么您不能在客户端上打开程序(例如资源管理器)的原因。

您不能在客户端上执行此操作,执行此操作的最佳方法可能是拥有一个TextArea,您可以在其中放置文件夹的链接。这样,当用户单击链接时,它将打开资源管理器。