changeset 170:57904d72fc09

update
author one
date Fri, 21 Oct 2011 16:40:47 +0900
parents 4ee9cfadd8dc
children ffc16faf011a
files src/myVncProxy/AcceptClient.java src/myVncProxy/VncProxyService.java
diffstat 2 files changed, 28 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/myVncProxy/AcceptClient.java	Mon Sep 12 16:36:40 2011 +0900
+++ b/src/myVncProxy/AcceptClient.java	Fri Oct 21 16:40:47 2011 +0900
@@ -23,6 +23,7 @@
 		this.name = name;
 	}
 
+
 	public AcceptClient() {
 		new CreateThread(this);
 	}
--- a/src/myVncProxy/VncProxyService.java	Mon Sep 12 16:36:40 2011 +0900
+++ b/src/myVncProxy/VncProxyService.java	Fri Oct 21 16:40:47 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;
@@ -201,7 +202,11 @@
 	//
 
 	void connectAndAuthenticate() throws Exception {
-	    acc = new AcceptClient(mainArgs[0]);
+		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();
@@ -283,7 +288,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;
 	}
 
@@ -537,10 +546,17 @@
 	//
 
 	void readParameters() {
-
-		host = mainArgs[0];
+		if(mainArgs.length==0){
+			getHost = new TextBox();
+			getHost.ipRegister();
+			host = getHost.getAddress();
+		} else {
+			host = mainArgs[0];
+		}
+		
 		if(mainArgs.length < 2){
-			port = 5900;
+			port = Integer.parseInt(getHost.getPort());
+//			port = 5900;
 		}else{
 			port = Integer.parseInt(mainArgs[1]);
 		}
@@ -590,8 +606,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);