`
shishui5271314
  • 浏览: 9392 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Java局域网远程控制

阅读更多
package org.fw.qq.plugins.remoteassistance;

import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

public class ControlCarrier implements Serializable {

	private String type;
	private int mouseX = -1;
	private int mouseY = -1;
	private int wheelAmt = -1;
	private int mousePressBtn = -1;
	private int mouseReleaseBtn = -1;
	private List<Integer> keyPressCode = new ArrayList<Integer>();
	private List<Integer> keyReleaseCode = new ArrayList<Integer>();
	private byte[] desktopImg = null;

	public byte[] getDesktopImg() {
		return desktopImg;
	}
	public void setDesktopImg(byte[] desktopImg) {
		this.desktopImg = desktopImg;
	}
	public int getMousePressBtn() {
		return mousePressBtn;
	}
	public void setMousePressBtn(int mousePressBtn) {
		this.mousePressBtn = mousePressBtn;
	}
	public int getMouseReleaseBtn() {
		return mouseReleaseBtn;
	}
	public void setMouseReleaseBtn(int mouseReleaseBtn) {
		this.mouseReleaseBtn = mouseReleaseBtn;
	}
	public int getMouseX() {
		return mouseX;
	}
	public void setMouseX(int mouseX) {
		this.mouseX = mouseX;
	}
	public int getMouseY() {
		return mouseY;
	}
	public void setMouseY(int mouseY) {
		this.mouseY = mouseY;
	}
	public int getWheelAmt() {
		return wheelAmt;
	}
	public void setWheelAmt(int wheelAmt) {
		this.wheelAmt = wheelAmt;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -3074156105274743383L;

	public List<Integer> getKeyPressCode() {
		return keyPressCode;
	}
	public void setKeyPressCode(List<Integer> keyPressCode) {
		this.keyPressCode = keyPressCode;
	}
	public List<Integer> getKeyReleaseCode() {
		return keyReleaseCode;
	}
	public void setKeyReleaseCode(List<Integer> keyReleaseCode) {
		this.keyReleaseCode = keyReleaseCode;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		PropertyDescriptor[] pd = null;
		try {
			pd = Introspector.getBeanInfo(this.getClass()).getPropertyDescriptors();
			for (PropertyDescriptor propertyDescriptor : pd) {
				Method method = propertyDescriptor.getReadMethod();
				builder.append("\n ");
				builder.append(propertyDescriptor.getName());
				builder.append(" : ");
				builder.append(method.invoke(this));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return builder.toString();
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
}

 

package org.fw.qq.plugins.remoteassistance;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class Client extends JPanel implements MouseListener, MouseMotionListener, MouseWheelListener, KeyListener {

	/**
	 * 
	 */
	private static final long serialVersionUID = -806686211556049511L;
	private String controlIp;
	private int controlPort;
	private BufferedImage controlDesktop;

	public Client(String controlIp, int controlPort) {
		this.controlIp = controlIp;
		this.controlPort = controlPort;

		setFocusable(true);
		this.addMouseListener(this);
		this.addMouseMotionListener(this);
		this.addMouseWheelListener(this);
		this.addKeyListener(this);

	}

	public void start() {
		ControlCarrier command = new ControlCarrier();
		sendControlCommand(command);
	}

	public void paintComponent(Graphics g) {
		if (controlDesktop != null) {
			g.drawImage(controlDesktop, 0, 0, this);
		}
	}

	private void sendControlCommand(ControlCarrier command) {
		ObjectOutputStream objectOut = null;
		ObjectInputStream objectInput = null;
		try {
			Socket commandSocket = new Socket(InetAddress.getByName(controlIp), controlPort);
			objectOut = new ObjectOutputStream(new BufferedOutputStream(commandSocket.getOutputStream()));
			objectOut.writeObject(command);
			objectOut.flush();

			objectInput = new ObjectInputStream(new BufferedInputStream(commandSocket.getInputStream()));
			ControlCarrier desktopState = (ControlCarrier) objectInput.readObject();
			displayDesktopState(desktopState);
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} finally {
			if (objectOut != null) {
				try {
					objectOut.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}

			if (objectInput != null) {
				try {
					objectInput.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}

	private void displayDesktopState(ControlCarrier desktopState) {
		ByteArrayInputStream bin = new ByteArrayInputStream(desktopState.getDesktopImg());
		try {
			controlDesktop = ImageIO.read(bin);
		} catch (IOException e) {
			e.printStackTrace();
			JOptionPane.showMessageDialog(null, "被控制端已断开连接,或网络异常!");
		}
		repaint();
	}

	public void mouseClicked(MouseEvent e) {
		ControlCarrier command = new ControlCarrier();
		command.setType("mouseClicked");
		if (e.getClickCount() == 1) {
			if (e.getButton() == MouseEvent.BUTTON1) {
				command.setMousePressBtn(InputEvent.BUTTON1_MASK);
				command.setMouseReleaseBtn(InputEvent.BUTTON1_MASK);
			} else if (e.getButton() == MouseEvent.BUTTON2) {
				command.setMousePressBtn(InputEvent.BUTTON2_MASK);
				command.setMouseReleaseBtn(InputEvent.BUTTON2_MASK);
			} else if (e.getButton() == MouseEvent.BUTTON3) {
				command.setMousePressBtn(InputEvent.BUTTON3_MASK);
				command.setMouseReleaseBtn(InputEvent.BUTTON3_MASK);
			}
		} else if (e.getClickCount() == 2) {
			if (e.getButton() == MouseEvent.BUTTON1) {
				command.setMousePressBtn(InputEvent.BUTTON1_MASK);
				command.setMouseReleaseBtn(InputEvent.BUTTON1_MASK);
				command.setMousePressBtn(InputEvent.BUTTON1_MASK);
				command.setMouseReleaseBtn(InputEvent.BUTTON1_MASK);
			} else if (e.getButton() == MouseEvent.BUTTON2) {
				command.setMousePressBtn(InputEvent.BUTTON2_MASK);
				command.setMouseReleaseBtn(InputEvent.BUTTON2_MASK);
				command.setMousePressBtn(InputEvent.BUTTON2_MASK);
				command.setMouseReleaseBtn(InputEvent.BUTTON2_MASK);
			} else if (e.getButton() == MouseEvent.BUTTON3) {
				command.setMousePressBtn(InputEvent.BUTTON3_MASK);
				command.setMouseReleaseBtn(InputEvent.BUTTON3_MASK);
				command.setMousePressBtn(InputEvent.BUTTON3_MASK);
				command.setMouseReleaseBtn(InputEvent.BUTTON3_MASK);
			}
		}
		sendControlCommand(command);
	}

	public void mouseEntered(MouseEvent e) {

	}

	public void mouseExited(MouseEvent e) {

	}

	public void mousePressed(MouseEvent e) {
		ControlCarrier command = new ControlCarrier();
		command.setType("mousePressed");
		if (e.getButton() == MouseEvent.BUTTON1) {
			command.setMousePressBtn(InputEvent.BUTTON1_MASK);
		} else if (e.getButton() == MouseEvent.BUTTON2) {
			command.setMousePressBtn(InputEvent.BUTTON2_MASK);
		} else if (e.getButton() == MouseEvent.BUTTON3) {
			command.setMousePressBtn(InputEvent.BUTTON3_MASK);
		}
		sendControlCommand(command);
	}

	public void mouseReleased(MouseEvent e) {
		ControlCarrier command = new ControlCarrier();
		command.setType("mouseReleased");
		if (e.getButton() == MouseEvent.BUTTON1) {
			command.setMouseReleaseBtn(InputEvent.BUTTON1_MASK);
		} else if (e.getButton() == MouseEvent.BUTTON2) {
			command.setMouseReleaseBtn(InputEvent.BUTTON2_MASK);
		} else if (e.getButton() == MouseEvent.BUTTON3) {
			command.setMouseReleaseBtn(InputEvent.BUTTON3_MASK);
		}
		sendControlCommand(command);
	}

	public void mouseDragged(MouseEvent e) {
		ControlCarrier command = new ControlCarrier();
		command.setType("mouseDragged");
		command.setMousePressBtn(e.getButton());
		command.setMouseX(e.getX());
		command.setMouseY(e.getY());
		sendControlCommand(command);
	}

	public void mouseMoved(MouseEvent e) {
		ControlCarrier command = new ControlCarrier();
		command.setType("mouseMoved");
		command.setMouseX(e.getX());
		command.setMouseY(e.getY());
		sendControlCommand(command);
	}

	public void mouseWheelMoved(MouseWheelEvent e) {
		ControlCarrier command = new ControlCarrier();
		command.setType("mouseWheelMoved");
		command.setWheelAmt(e.getWheelRotation());
		sendControlCommand(command);
	}

	public void keyPressed(KeyEvent e) {

		ControlCarrier command = new ControlCarrier();
		command.setType("keyPressed");
		List<Integer> keyPress = new ArrayList<Integer>();
		if (e.isControlDown()) {
			keyPress.add(KeyEvent.VK_CONTROL);
		}
		if (e.isAltDown()) {
			keyPress.add(KeyEvent.VK_ALT);
		}
		if (e.isShiftDown()) {
			keyPress.add(KeyEvent.VK_SHIFT);
		}
		keyPress.add(e.getKeyCode());
		command.setKeyPressCode(keyPress);
		sendControlCommand(command);
	}

	public void keyReleased(KeyEvent e) {
		ControlCarrier command = new ControlCarrier();
		command.setType("keyReleased");
		List<Integer> keyRelease = new ArrayList<Integer>();
		keyRelease.add(e.getKeyCode());
		command.setKeyReleaseCode(keyRelease);
		sendControlCommand(command);
	}

	public void keyTyped(KeyEvent e) {

	}

	public Dimension getPreferredSize() {
		return new Dimension(getWidth(), getHeight());
	}

	public static void main(String[] args) {
		JFrame frame = new JFrame("远程控制");
		String ip = JOptionPane.showInputDialog("请输入远程连接IP");
		if ("null".equals(ip)) {
			System.exit(0);
		}
		while (ip.isEmpty()) {
			ip = JOptionPane.showInputDialog("请输入远程连接IP");
		}
		while (!StringUtil.isValidIP(ip)) {
			ip = JOptionPane.showInputDialog("请输入合法IP");
		}

		String port = JOptionPane.showInputDialog("输入远程连接端口");
		if ("null".equals(port)) {
			System.exit(0);
		}
		while (port.isEmpty()) {
			port = JOptionPane.showInputDialog("请输入远程连接端口");
		}
		while (!StringUtil.isValidPort(port)) {
			port = JOptionPane.showInputDialog("请输入合法端口");
		}
		JOptionPane.showMessageDialog(null, "开始远程连接!");

		Client client = new Client(ip, Integer.parseInt(port));
		JScrollPane jsp = new JScrollPane(client, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		frame.add(jsp);
		frame.setDefaultCloseOperation(3);
		frame.setSize(800, 600);
		frame.setVisible(true);
	}

}

 

package org.fw.qq.plugins.remoteassistance;

import java.awt.AWTException;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

import javax.imageio.ImageIO;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

public class Server extends JPanel implements Runnable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -927388268343256207L;
	private ServerSocket server;
	private Thread thread;
	private Robot controlMouseRobot;
	private JButton releaseConnect;
	private JLabel label;

	public Server(String ip, int port) throws IOException, AWTException {
		server = new ServerSocket(port, 1, InetAddress.getByName(ip));
		thread = new Thread(this);
		controlMouseRobot = new Robot();

		label = new JLabel("监听" + ip + ":" + port);
		
		releaseConnect = new JButton("断开连接");
		this.add(releaseConnect);
		releaseConnect.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				stop();
			}
		});
		this.add(label);
		this.add(releaseConnect);
	}

	public void start() {
		thread.start();
	}

	@SuppressWarnings("deprecation")
	public void stop() {
		label.setText("已断开连接");
		thread.stop();
		try {
			server.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void run() {

		while (true) {
			ObjectInputStream request = null;
			ObjectOutputStream response = null;
			try {
				Socket client = server.accept();
				label.setText("被控制中");
				request = new ObjectInputStream(new BufferedInputStream(client.getInputStream()));
				ControlCarrier carrier = (ControlCarrier) request.readObject();

				System.out.println("收到命令:" + carrier);

				if (carrier.getMouseX() != -1 && carrier.getMouseY() != -1) {
					controlMouseRobot.mouseMove(carrier.getMouseX(), carrier.getMouseY());
				}

				if (carrier.getMousePressBtn() != -1) {
					controlMouseRobot.mousePress(carrier.getMousePressBtn());
				}

				if (carrier.getMouseReleaseBtn() != -1) {
					controlMouseRobot.mouseRelease(carrier.getMouseReleaseBtn());
				}

				if (carrier.getWheelAmt() != -1) {
					controlMouseRobot.mouseWheel(carrier.getWheelAmt());
				}

				for (Integer pressKey : carrier.getKeyPressCode()) {
					controlMouseRobot.keyPress(pressKey);
				}

				for (Integer releaseKey : carrier.getKeyReleaseCode()) {
					controlMouseRobot.keyRelease(releaseKey);
				}

				Dimension desktopSize = Toolkit.getDefaultToolkit().getScreenSize();
				BufferedImage curDesktop = controlMouseRobot.createScreenCapture(new Rectangle(desktopSize));
				ByteArrayOutputStream out = new ByteArrayOutputStream();
				ImageIO.write(curDesktop, "jpg", out);
				ControlCarrier desktopState = new ControlCarrier();
				desktopState.setDesktopImg(out.toByteArray());

				response = new ObjectOutputStream(new BufferedOutputStream(client.getOutputStream()));
				response.writeObject(desktopState);
				response.flush();

			} catch (IOException e) {
				e.printStackTrace();
			} catch (ClassNotFoundException e) {
				e.printStackTrace();
			} finally {

				if (request != null) {
					try {
						request.close();
					} catch (IOException e) {
						e.printStackTrace();
					}
				}

				if (response != null) {
					try {
						response.close();
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
			}
		}

	}

	public static void main(String[] args) {
		Server server;
		try {

			String ip = JOptionPane.showInputDialog("请输入本地IP");
			if ("null".equals(ip)) {
				System.exit(0);
			}
			while (ip.isEmpty()) {
				ip = JOptionPane.showInputDialog("请输入本地IP");
			}
			while (!StringUtil.isValidIP(ip)) {
				ip = JOptionPane.showInputDialog("请输入合法IP");
			}

			String port = JOptionPane.showInputDialog("请输入本地端口");
			if ("null".equals(port)) {
				System.exit(0);
			}
			while (port.isEmpty()) {
				port = JOptionPane.showInputDialog("请输入本地端口");
			}
			while (!StringUtil.isValidPort(port)) {
				port = JOptionPane.showInputDialog("请输入合法端口");
			}
			while (!StringUtil.isPortUsed(Integer.parseInt(port))) {
				port = JOptionPane.showInputDialog("端口被占用,请输入其他端口");
			}
			server = new Server(ip, Integer.parseInt(port));
			server.start();
			
			JFrame frame = new JFrame("远程连接被控制端");
			frame.add(server);
			frame.setSize(300,85);
			frame.setDefaultCloseOperation(3);
			frame.setVisible(true);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (AWTException e) {
			e.printStackTrace();
		}
	}

}

 

package org.fw.qq.plugins.remoteassistance.demo;

import java.awt.AWTException;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;

import org.fw.qq.plugins.remoteassistance.Client;
import org.fw.qq.plugins.remoteassistance.Server;
import org.fw.qq.plugins.remoteassistance.StringUtil;

public class RemoteAssistance extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -502914245090231502L;
	private JRadioButton serverJRB;
	private JRadioButton clientJRB;
	private ButtonGroup btnGroup;
	private JLabel infoJL;
	private JButton okBtn;

	public RemoteAssistance() {

		initComponent();
		registerListeners();

	}

	private void registerListeners() {
		okBtn.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent e) {
				if (serverJRB.isSelected()) {
					createServer();
				} else if (clientJRB.isSelected()) {
					createClient();
				}
			}

			private void createClient() {
				JFrame frame = new JFrame("远程控制");
				String ip = JOptionPane.showInputDialog("请输入远程连接IP");
				if ("null".equals(ip)) {
					System.exit(0);
				}
				while (ip.isEmpty()) {
					ip = JOptionPane.showInputDialog("请输入远程连接IP");
				}
				while (!StringUtil.isValidIP(ip)) {
					ip = JOptionPane.showInputDialog("请输入合法IP");
				}

				String port = JOptionPane.showInputDialog("输入远程连接端口");
				if ("null".equals(port)) {
					System.exit(0);
				}
				while (port.isEmpty()) {
					port = JOptionPane.showInputDialog("请输入远程连接端口");
				}
				while (!StringUtil.isValidPort(port)) {
					port = JOptionPane.showInputDialog("请输入合法端口");
				}
				JOptionPane.showMessageDialog(null, "开始远程连接!");

				Client client = new Client(ip, Integer.parseInt(port));
				JScrollPane jsp = new JScrollPane(client, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
				frame.add(jsp);
				frame.setDefaultCloseOperation(3);
				frame.setSize(800, 600);
				frame.setVisible(true);
			}

			private void createServer() {
				Server server;
				try {

					String ip = JOptionPane.showInputDialog("请输入本地IP");
					if ("null".equals(ip)) {
						System.exit(0);
					}
					while (ip.isEmpty()) {
						ip = JOptionPane.showInputDialog("请输入本地IP");
					}
					while (!StringUtil.isValidIP(ip)) {
						ip = JOptionPane.showInputDialog("请输入合法IP");
					}

					String port = JOptionPane.showInputDialog("请输入本地端口");
					if ("null".equals(port)) {
						System.exit(0);
					}
					while (port.isEmpty()) {
						port = JOptionPane.showInputDialog("请输入本地端口");
					}
					while (!StringUtil.isValidPort(port)) {
						port = JOptionPane.showInputDialog("请输入合法端口");
					}
					while (!StringUtil.isPortUsed(Integer.parseInt(port))) {
						port = JOptionPane.showInputDialog("端口被占用,请输入其他端口");
					}
					server = new Server(ip, Integer.parseInt(port));
					server.start();

					JFrame frame = new JFrame("远程连接被控制端");
					frame.add(server);
					frame.setSize(300, 85);
					frame.setDefaultCloseOperation(3);
					frame.setVisible(true);
				} catch (IOException e) {
					e.printStackTrace();
				} catch (AWTException e) {
					e.printStackTrace();
				}
			}

		});
	}

	private void initComponent() {
		infoJL = new JLabel("请选择");
		btnGroup = new ButtonGroup();
		serverJRB = new JRadioButton("被控制者");
		serverJRB.setSelected(true);
		clientJRB = new JRadioButton("控制端");
		btnGroup.add(serverJRB);
		btnGroup.add(clientJRB);
		okBtn = new JButton("确定");
		setLayout(new FlowLayout());
		this.add(infoJL);
		this.add(serverJRB);
		this.add(clientJRB);
		this.add(okBtn);
	}

	public static void main(String[] args) {
		RemoteAssistance demo = new RemoteAssistance();
		demo.setTitle("远程协助");
		demo.setDefaultCloseOperation(3);
		demo.setSize(320, 240);
		demo.setVisible(true);
	}

}

 

package org.fw.qq.plugins.remoteassistance;

import java.net.DatagramSocket;
import java.net.SocketException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringUtil {

	/*
	 * 检测端口是否被用
	 */
	public static boolean isPortUsed(int port) {
		try {
			DatagramSocket socket = new DatagramSocket(port);
			socket.close();
			return true;
		} catch (SocketException e) {
			return false;
		}
	}

	public static boolean isValidIP(String ipAddress) {
		String ip = "([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}";
		Pattern pattern = Pattern.compile(ip);
		Matcher matcher = pattern.matcher(ipAddress);
		return matcher.matches();
	}

	public static boolean isValidPort(String port) {
		try {
			int temp = Integer.parseInt(port);
			if (temp > 0 && temp < 65535)
				return true;
		} catch (Exception e) {
			return false;
		}
		return false;
	}
}

 效果图:



 

 

  • 大小: 303.4 KB
0
2
分享到:
评论
1 楼 lpy3654321 2013-08-07  
能解决一下代码吗??有点看不懂

相关推荐

    java实现的远程控制 源码

    【标题】:“java实现的远程控制 源码”揭示了这个项目是使用Java编程语言构建的一个远程控制程序。远程控制通常涉及到一个客户端和服务器端的通信,允许用户通过网络对另一台计算机进行操作。在这个特定的案例中,...

    java远程屏幕共享程序(局域网)

    本项目“java远程屏幕共享程序(局域网)”就是这样一个实现,它采用Java编程语言,提供了客户端(Client.jar)和服务器端(Server.jar)两个组成部分,适合于局域网内的设备间进行屏幕共享。以下将详细解析这个项目...

    JAVA局域网通讯源码,支持文件传输和远程控制

    用JAVA开发的局域网通讯,类似于飞鸽,可在Linux下正常运行,实现了聊天,文件传送,远程控制的功能。。源码附上。。 大家下载了请改下MainUI类里的updateTree()方法就可以看到自己了。。。

    JAVA 局域网对战五子棋游戏(基于RMI)

    在这个特定的项目中,我们探讨的是一个基于JAVA编程语言的五子棋游戏,它利用了RMI(Remote Method Invocation,远程方法调用)技术来实现在局域网内的多玩家对战。下面将详细解释这个项目的核心知识点: 1. **JAVA...

    java局域网文件传

    【Java局域网文件传输】涉及的技术点主要集中在Java的网络编程、图形用户界面(GUI)设计以及文件操作上。以下是对这些知识点的详细说明: 1. **Java网络编程**: - **Socket通信**:Java中的`java.net.Socket`类是...

    JAVA实现局域网桌面共享

    用户应该能够看到远程桌面,并且可能需要一些控制选项,如暂停/恢复共享、调整画质等。 6. **配置文件**:项目中的`config`目录可能包含了服务器的配置信息,如IP地址、端口号等。JAVA的Properties类可用于读取和...

    java 局域网监控程序

    6. **远程控制**:通过Java的RMI(远程方法调用)或SSH(安全外壳协议)技术,程序可能提供远程命令执行、文件传输等功能,让管理员能从一台机器上管理其他设备。 7. **警报和通知**:当检测到异常活动时,程序可以...

    java 远程控制客户端和服务器端代码详细

    在Java编程领域,远程控制是一种常见且实用的功能,它允许用户通过网络操作远程计算机,实现类似于本地操作的效果。本文将详细讲解如何使用Java实现客户端和服务器端的远程控制功能,包括屏幕共享、鼠标和键盘操作,...

    JAVA办公局域网设计论文

    JAVA提供了多种安全机制,包括SSL/TLS协议进行数据加密,JAAS(Java Authentication and Authorization Service)进行用户身份验证和权限控制,以及JCE(Java Cryptography Extension)扩展了加密算法。这些机制能够...

    【毕业设计】局域网中远程桌面监控系统的设计与实现

    本文主要探讨了一种基于Java语言,利用NetBeans IDE 6.7开发的局域网远程桌面监控系统的设计与实现过程。 首先,该系统的核心目标是使维护人员能够在局域网内远程控制和管理多台计算机,实现实时监控计算机运行状态...

    java通过网络远程开机

    在同一个局域网(LAN)环境下,我们可以利用Java编程语言来发送WoL魔法包(Magic Packet),从而实现远程开机。 首先,理解Wake-on-LAN协议是必要的。WoL协议通常在目标设备(如电脑)的BIOS或网络适配器设置中开启...

    简单局域网手机控制PC

    在IT领域,构建一个简单的局域网手机控制PC系统是一项实用的技术实现,它允许用户通过手机设备对连接在同一网络下的个人计算机(PC)进行远程操作。这个系统的主要功能包括远程关机、重启、休眠以及将剪贴板内容发送...

    java 局域网聊天 ,文件传输 工具

    描述中提到的“基于TCP,和UDP实现的文件传输和局域网聊天”,揭示了这个工具使用两种不同的网络传输协议:TCP(传输控制协议)和UDP(用户数据报协议)。TCP是一种面向连接的协议,提供可靠的数据传输服务,确保数据...

    局域网中远程桌面监控系统的设计与实现.doc

    远程桌面监控系统是指通过局域网连接的计算机之间,为了实现远程监控和控制的系统。该系统可以让本地计算机通过局域网访问不同的远程计算机,并对其进行操作。维护人员可以通过本系统实时地监控联网计算机的运行情况...

    关于Internet远程控制的研究和开发

    远程控制技术涵盖了多种网络环境,包括局域网(LAN)、广域网(WAN)、拨号连接,以及现在最常见的互联网连接。某些高级的远程控制软件甚至可以通过串口、并口或红外端口进行远程操作。 一、远程控制技术的基本概念...

    8266局域网控制.rar

    8266模块则可以为51单片机提供无线网络能力,使其能够接入WiFi网络,从而实现远程控制和数据传输。 提到“手机连接后,可以控制外部电路”,意味着项目包含了一个手机应用程序,用户可以通过该APP连接到8266建立的...

    基于Java局域网飞鸽传书软件毕设(源代码+使用文档)

    系统概述 局域网飞鸽传书软件通常包括以下几个关键组件: 用户界面(UI):提供用户交互界面,用于选择文件、设置传输参数等。...易于扩展:可以在此基础上增加更多功能,如远程控制、消息通信等。

    基于java开发的手机远程控制,实现手机拍照,对焦,拍照远程预览,在控制的手机实时查看被控制手机相机画面+源码(高分优秀项目)

    基于java开发的手机远程控制,实现手机拍照,对焦,拍照远程预览,在控制的手机实时查看被控制手机相机画面+源码,适合毕业设计、课程设计、项目开发。项目源码已经过严格测试,可以放心参考并在此基础上延申使用~ ...

    局域网桌面共享软件(JAVA版)

    【局域网桌面共享软件(JAVA版)】是一款基于JAVA技术开发的实用工具,它能够实现本地及局域网内的多台计算机之间的桌面共享、实时成像、聊天以及远程协助功能。这款软件的核心优势在于其跨平台性,由于JAVA的“一次...

Global site tag (gtag.js) - Google Analytics