2014-01-09 101 views
0

這些都不工作:獲取命令行參數與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 declarederror JS1135: Variable 'Environment' has not been declaredEven in MSDN沒有jscript的例子。有可能在jscript.net中獲取參數嗎?

回答

2

這工作:

import System; 

var arguments:String[] = Environment.GetCommandLineArgs(); 
print(arguments[0]); 
print(arguments[1]); 

雖然arguments[0]總是編譯/名爲.exe文件的名稱。