mythread1.java

来自「应用公钥加密体制的代表算法RSA 应用对称加密算法DES 应用散列算法MD5」· Java 代码 · 共 50 行

JAVA
50
字号
/* * mythread1.java * * Created on 2007年12月4日, 下午6:57 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */package b;import java.net.*;import java.io.*;import javax.swing.JOptionPane;import java.awt.*;/** * * @author guowen */public class mythread1 extends Thread {           public mythread1() {    }        public  void run(){       try{           ServerSocket ss=new ServerSocket(6123);           Socket s=ss.accept();           InputStream ips=s.getInputStream();           OutputStream ops=s.getOutputStream();                      int num=ips.available();           byte[] buf=new byte[num];           int len=ips.read(buf);                      FileOutputStream fos=new FileOutputStream("RSA_ENCRYPT.txt");           fos.write(buf,0,len);           JOptionPane.showMessageDialog(new Frame(),"注意查收文件!!");           fos.close();           ops.close();           ips.close();                }catch(Exception e){           System.out.println(e);       }            }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?