# HG changeset patch # User e085711 # Date 1303850280 -32400 # Node ID cb0e4fd2d982d19f0f20d9305a0fbf93357dd175 # Parent a0e1fc94d3447c00ff0adc09a6665198412df90b upload CreateHtmlFile.java diff -r a0e1fc94d344 -r cb0e4fd2d982 src/myVncProxy/VncProxyService.java --- a/src/myVncProxy/VncProxyService.java Wed Apr 27 02:33:08 2011 +0900 +++ b/src/myVncProxy/VncProxyService.java Wed Apr 27 05:38:00 2011 +0900 @@ -18,6 +18,9 @@ } String[] mainArgs; + String username; + + CreateHtmlFile htmlFile; // RfbProto rfb; MyRfbProto rfb; @@ -59,10 +62,14 @@ void checkArgs(String[] argv){ - if(argv.length < 2){ + if(argv.length > 3){ + username = argv[3]; + }else if(argv.length < 2){ System.out.println("Please enter argv"); System.out.println("hostname(IPaddress) port password"); System.exit(0); + }else{ + username = argv[0]; } } @@ -110,11 +117,9 @@ try { // connectAndAuthenticate(); doProtocolInitialisation(); - - System.out.println(""); - System.out.println(""); - System.out.println(""); + + htmlFile = new CreateHtmlFile(rfb, host, username); + htmlFile.createHtml(); vc = new ProxyVncCanvas(this, 0, 0); vc.updateFramebufferSize(); @@ -260,7 +265,7 @@ vncContainer.remove(authPanel); */ showConnectionStatus("ask password..."); - String pw = mainArgs[1]; + String pw = mainArgs[2]; return pw; } @@ -514,13 +519,11 @@ void readParameters() { host = mainArgs[0]; - if(mainArgs.length < 3){ + if(mainArgs.length < 2){ port = 5900; }else{ - port = Integer.parseInt(mainArgs[2]); + port = Integer.parseInt(mainArgs[1]); } - - // Read "ENCPASSWORD" or "PASSWORD" parameter if specified. @@ -568,7 +571,7 @@ private void readPasswordParameters() { // String encPasswordParam = readParameter("ENCPASSWORD", false); - String encPasswordParam = mainArgs[1]; + String encPasswordParam = mainArgs[2]; if (encPasswordParam == null) { // passwordParam = readParameter("PASSWORD", false);