java 远程监控系统

上传者: charles_yee | 上传时间: 2020-01-03 11:18:05 | 文件大小: 13KB | 文件类型: rar
实现本地电脑监控服务器端电脑监控功能 public class Client { // 入口 public static void main(String[] args) { try { int choice = JOptionPane.showConfirmDialog(null, "请求控制对方电脑", "远程控制系统-Charles", JOptionPane.YES_NO_OPTION); if (choice == JOptionPane.NO_OPTION) { return; } String input = JOptionPane.showInputDialog("请输入要连接电脑的ip(包括端口号)", "127.0.0.1:10000"); // 获取服务器的主机 String host = input.substring(0, input.indexOf(":")); // 获取服务器的端口号 String post = input.substring(input.indexOf(":") + 1); System.out.println("服务器的主机:" + host + " " + "端口号:" + post); Socket client = new Socket(host,Integer.parseInt(post)); DataInputStream dis = new DataInputStream(client.getInputStream()); JFrame jframe = new JFrame("本地监控系统 - Charles"); jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//默认关闭进程 jframe.setSize(1024, 768);// 设置窗体大小 double height = dis.readDouble(); double width = dis.readDouble(); Dimension ds = new Dimension((int)width, (int)height); //设置 jframe.setSize(ds); //将服务器图片作为背景 JLabel backImage = new JLabel(); JPanel panel = new JPanel(); //设置滚动条 JScrollPane scrollPane = new JScrollPane(panel); panel.setLayout(new FlowLayout()); panel.add(backImage); jframe.add(scrollPane); jframe.setAlwaysOnTop(true); jframe.setVisible(true); while(true){ int len = dis.readInt(); byte[] imageData = new byte[len]; dis.readFully(imageData); ImageIcon image = new ImageIcon(imageData); backImage.setIcon(image); jframe.repaint(); } } catch (Exception e) { e.printStackTrace(); } } }

文件下载

资源详情

[{"title":"( 17 个子文件 13KB ) java 远程监控系统","children":[{"title":"Charles_Screens_IM","children":[{"title":"src","children":[{"title":"com","children":[{"title":"dt","children":[{"title":"screen","children":[{"title":"Client.java <span style='color:#111;'> 2.23KB </span>","children":null,"spread":false},{"title":"Server.java <span style='color:#111;'> 2.22KB </span>","children":null,"spread":false}],"spread":true},{"title":"util","children":[{"title":"LocationScreen.java <span style='color:#111;'> 1.73KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".classpath <span style='color:#111;'> 1.11KB </span>","children":null,"spread":false},{"title":".settings","children":[{"title":"org.eclipse.wst.jsdt.ui.superType.container <span style='color:#111;'> 49B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.common.project.facet.core.xml <span style='color:#111;'> 398B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.jsdt.ui.superType.name <span style='color:#111;'> 6B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.common.component <span style='color:#111;'> 513B </span>","children":null,"spread":false},{"title":".jsdtscope <span style='color:#111;'> 522B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 364B </span>","children":null,"spread":false}],"spread":true},{"title":".project <span style='color:#111;'> 1.17KB </span>","children":null,"spread":false},{"title":"WebRoot","children":[{"title":"META-INF","children":[{"title":"MANIFEST.MF <span style='color:#111;'> 39B </span>","children":null,"spread":false}],"spread":true},{"title":"index.jsp <span style='color:#111;'> 829B </span>","children":null,"spread":false},{"title":"WEB-INF","children":[{"title":"classes","children":[{"title":"com","children":[{"title":"dt","children":[{"title":"screen","children":[{"title":"Server.class <span style='color:#111;'> 1.37KB </span>","children":null,"spread":false},{"title":"Client.class <span style='color:#111;'> 3.23KB </span>","children":null,"spread":false},{"title":"ScreenThread.class <span style='color:#111;'> 1.90KB </span>","children":null,"spread":false}],"spread":true},{"title":"util","children":[{"title":"LocationScreen.class <span style='color:#111;'> 1.85KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"lib","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • kongyuemei :
    挺好用的。
    2018-10-10

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明