我使用以下IronPython脚本打开Windows资源管理器到定义路径,该路径在客户端Spotfire中完美运行。
当我在SpotfireWebplayer中运行相同的脚本时,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 网络播放器中工作。
在 Spotfire 网络播放器上,脚本在服务器上运行。创建进程以执行程序时,将在服务器上创建该进程。这就是您无法在客户端上打开程序(如资源管理器(的原因。
您不能在客户端上执行此操作,执行此操作的最佳方法可能是拥有一个 TextArea,您可以在其中放置文件夹的链接。这样,当用户单击链接时,它将打开资源管理器。