【问题标题】:How to open Windows explorer with ironPython script from Spotfire Webplayer如何使用 Spotfire Webplayer 中的 ironPython 脚本打开 Windows 资源管理器
【发布时间】:2019-09-04 15:07:45
【问题描述】:

我使用下面的 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 中也能正常工作。

【问题讨论】:

    标签: ironpython explorer spotfire-webplayer


    【解决方案1】:

    在 Spotfire webplayer 上,脚本在服务器上运行。当你创建一个进程来执行一个程序时,它是在服务器上创建的。这就是您无法在客户端上打开程序(如资源管理器)的原因。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-27
      • 2012-06-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多