你好,我正在尝试使用
从Adobe Air设置Wifi热点 var netsh:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var file:File = File.applicationDirectory.resolvePath("C:/Windows/System32/netsh.exe");
netsh.executable = file;
var processArgs:Vector.<String> = new Vector.<String>();
processArgs.push("wlan set hostednetwork mode='allow' ssid='tests' key='tests123'");
netsh.arguments = processArgs;
process = new NativeProcess();
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.start(netsh);
应用程序正在启动,但不喜欢参数-抛出错误:
The following command was not found: "wlan set hostednetwork mode='allow' ssid='tests' key='tests123'".
有更好的方法吗?这可能吗?
我试过不加引号——这只是最近的尝试
可以了
var netsh:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var file:File = File.applicationDirectory.resolvePath("C:\Windows\System32\cmd.exe");
netsh.executable = file;
var processArgs:Vector.<String> = new Vector.<String>();
processArgs.push("/c netsh wlan set hostednetwork mode=allow ssid=test key=test1234");
netsh.arguments = processArgs;
process = new NativeProcess();
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.start(netsh);