使用jscript.net获取命令行参数 [英] Get command line arguments with jscript.net
本文介绍了使用jscript.net获取命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这些工作都没有:
var arguments = System.Environment.GetCommandLineArgs();
〜
var arguments = Environment.GetCommandLineArgs();
〜
var arguments:String[] = System.Environment.GetCommandLineArgs();
〜
var arguments:String[] = Environment.GetCommandLineArgs();
它打印JS1135: Variable 'System' has not been declared
或error JS1135: Variable 'Environment' has not been declared
. 甚至在MSDN中没有jscript的示例.是否可以在jscript.net中获取参数?
it prints JS1135: Variable 'System' has not been declared
or error JS1135: Variable 'Environment' has not been declared
. Even in MSDN there's no example with jscript. Is is possible to get the arguments in jscript.net ?
推荐答案
这有效:
import System;
var arguments:String[] = Environment.GetCommandLineArgs();
print(arguments[0]);
print(arguments[1]);
尽管arguments[0]
始终是已编译/调用的.exe文件的名称.
Though the arguments[0]
is always the name of the compiled/called .exe file.
这篇关于使用jscript.net获取命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文