ironpython - 如何使用 Spotfire Webplayer 中的 ironPython 脚本打开 Windows 资源管理器
问题描述
我使用下面的 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 中运行。
解决方案
在 Spotfire webplayer 上,脚本在服务器上运行。当你创建一个进程来执行一个程序时,它是在服务器上创建的。这就是为什么您无法在客户端上打开程序(如资源管理器)的原因。
您不能在客户端上执行此操作,最好的方法可能是有一个 TextArea,您可以在其中放置文件夹的链接。这样,当用户单击链接时,它会打开资源管理器。
推荐阅读
- macos - Mac OS High Sierra diskutil eraseDisk 导致错误:-69877:无法打开设备
- node.js - 猫鼬中的虚拟填充不起作用?
- angular - 开发和生产的不同 css 图像路径
- c# - VS 项目引用不断中断,即使在成功添加后也是如此
- json - 无法运行 npm start
- ios - 使用 NSLayoutConstraints 在 UIView 上进行简单的上滑动画
- oracle - Oracle 网络配置助手
- altair - Altair 彩色条形图按值未显示
- php - 如何在 Laravel 中上传多张图片
- nestjs - 何时在 NestJS 中使用 ExceptionFilter 与 BaseExceptionFilter?