import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;

public class lianxi {
public static void main(String[] args){
try {
DatagramSocket socket = new DatagramSocket();
FileInputStream fis = new FileInputStream("C:\\Users\\86176\\Desktop\\a.jpg");
byte[] bt = fis.readAllBytes();
DatagramPacket pack = new DatagramPacket(bt,bt.length, InetAddress.getByName("C:\\Users\\86176\\Desktop\\a.jpg"),8888);
socket.send(pack);
socket.close();
}catch (Exception e){
e.printStackTrace();
}

}
}
posted on 2020-10-20 21:31  liuyunche  阅读(193)  评论(0)    收藏  举报