Note that there are some explanatory texts on larger screens.

plurals
  1. POThe problem on Modify windows proxy settings via registry in adobe air?
    text
    copied!<p>I want to modify windows proxy settings in adobe air. Below is my code. It doesn't work. What's wrong with it? Thanks. </p> <pre><code>public function enableProxy(started:Boolean):void { if(NativeProcess.isSupported) { var OS:String = Capabilities.os.toLocaleLowerCase(); var file:File; if (OS.indexOf('win') &gt; -1) { //Executable in windows file = new File('C:\\Windows\\System32\\cmd.exe'); } else if (OS.indexOf('mac') &gt; -1 ) { //Executable in mac } else if (OS.indexOf('linux')) { //Executable in linux } var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo(); nativeProcessStartupInfo.executable = file; var args:Vector.&lt;String&gt; = new Vector.&lt;String&gt;(); args.push("C:\\test\\ModifyProxy.bat"); nativeProcessStartupInfo.arguments = args; startExecution(nativeProcessStartupInfo); } } private function startExecution(nativeProcessStartupInfo:NativeProcessStartupInfo):void { var nativeProcess:NativeProcess = new NativeProcess(); nativeProcess.addEventListener(NativeProcessExitEvent.EXIT, onExitError); var msg:String = ""; try { nativeProcess.start(nativeProcessStartupInfo); trace("Trying to start process"); } catch (error:IllegalOperationError) { trace("Illegal Operation: "+error.toString()); } catch (error:ArgumentError) { trace("Argument Error: "+error.toString()); } catch (error:Error) { trace("Error: "+error.toString()); } if (nativeProcess.running) { trace("Native Process Support"); } } public function onExitError(event:NativeProcessExitEvent):void { trace("Native Process Exit code: " + event.exitCode); } </code></pre> <p>ModifyProxy.bat</p> <p>REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "http=testwronguw:8888;https=testwronguw:8888;" /t REG_SZ /f</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload