Mercurial > hg > Members > nobuyasu > tightVNCProxy
view src/myVncProxy/CreateHtmlFile.java @ 129:0571d955da35
print connection speed.
author | e085711 |
---|---|
date | Thu, 04 Aug 2011 15:11:30 +0900 |
parents | 7fa7dfeb88d1 |
children |
line wrap: on
line source
package myVncProxy; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.PrintWriter; import java.net.InetAddress; public class CreateHtmlFile { String header="<HTML><TITLE>hbpVNC desktop</TITLE>\n"; String footer="</APPLET>\n<BR>\n<A href=\"http://ie.u-ryukyu.ac.jp/\">University of the Ryukyu </A>\n</HTML>\n"; String host; String user; int port; int width; int height; File file; MyRfbProto rfb; CreateHtmlFile(MyRfbProto _rfb, String _host, String _user){ rfb = _rfb; host = _host; user = _user; port = rfb.getAcceptPort(); width = rfb.framebufferWidth; height = rfb.framebufferHeight; } void createHtml(){ try{ // String html_file = "/var/www/html/hbpVNC/view/"+ user +".html"; String html_file = "./"+ user +".html"; file = new File(html_file); PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file))); InetAddress addr = InetAddress.getLocalHost(); String contents = "<APPLET CODE=\"VncViewer.class\" ARCHIVE=\"VncViewer.jar\"\n " + "WIDTH=\""+width+"\" HEIGHT=\""+height+"\">\n"; contents = contents+"<PARAM NAME=\"PORT\" VALUE=\""+port+"\">\n"; contents = contents+"<PARAM NAME=\"HOST\" VALUE=\""+addr.getHostAddress()+"\">\n"; pw.println(header+contents+footer); pw.close(); } catch (Exception e) { e.printStackTrace(); } } }