# HG changeset patch # User Yu Taninari # Date 1319454983 -32400 # Node ID eea9a1726edf4185b06e928f4d6d9627fbd854c0 # Parent 607f31debca1625e36668672a790e3f41ffaf48a# Parent 54ad8e0654b505855fa585eac4247a2633852d6a merge diff -r 607f31debca1 -r eea9a1726edf src/myVncProxy/AcceptClient.java diff -r 607f31debca1 -r eea9a1726edf src/myVncProxy/VncProxyService.java --- a/src/myVncProxy/VncProxyService.java Mon Oct 24 20:15:24 2011 +0900 +++ b/src/myVncProxy/VncProxyService.java Mon Oct 24 20:16:23 2011 +0900 @@ -9,7 +9,7 @@ public static void main(String[] argv) { VncProxyService v = new VncProxyService(); - v.checkArgs(argv); + //v.checkArgs(argv); v.mainArgs = argv; @@ -29,6 +29,7 @@ Thread clientThread; CreateThread geth; AcceptClient acc; + private TextBox getHost; Frame vncFrame; Container vncContainer; @@ -268,7 +269,11 @@ // void connectAndAuthenticate() throws Exception { - acc = new AcceptClient(host); + if(mainArgs.length==0) + acc = new AcceptClient(getHost.getAddress()); + //acc = new AcceptClient(); + else + acc = new AcceptClient(mainArgs[0]); geth = new CreateThread(acc , echoPort); Thread thread = new Thread(geth); thread.start(); @@ -352,7 +357,11 @@ vncContainer.remove(authPanel); */ showConnectionStatus("ask password..."); - String pw = mainArgs[2]; + String pw; + if(mainArgs.length!=0) + pw = mainArgs[2]; + else + pw = getHost.getPassword(); return pw; } @@ -614,6 +623,21 @@ // void readParameters() { + if(mainArgs.length==0){ + getHost = new TextBox(); + getHost.ipRegister(); + host = getHost.getAddress(); + } else { + host = mainArgs[0]; + } + + if(mainArgs.length < 2){ + port = Integer.parseInt(getHost.getPort()); +// port = 5900; + }else{ + port = Integer.parseInt(mainArgs[1]); + } + // Read "ENCPASSWORD" or "PASSWORD" parameter if specified. // readPasswordParameters(); @@ -659,8 +683,12 @@ // private void readPasswordParameters() { + String encPasswordParam; // String encPasswordParam = readParameter("ENCPASSWORD", false); - String encPasswordParam = mainArgs[2]; + if(mainArgs.length!=0) + encPasswordParam = mainArgs[2]; + else + encPasswordParam = getHost.getPassword(); if (encPasswordParam == null) { // passwordParam = readParameter("PASSWORD", false);