基于TCP文件发送 public void send() { Scanner input = new Scanner(System.in); Socket socket = null; String s = input.nextLine(); System.out.println(s); File file = new File(s); String name = file.getName();