返回顶部

收藏

Visual Studio 6.0安装程序外挂,自动安装

更多
package vc;
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.event.*;
import java.io.*;

public class vcInstaller {
    public static void main(String[] args) {
        try {
            Runtime.getRuntime().exec(".\\\\VisualStudio\\\\SETUP.EXE");
        } catch (IOException e) {
            System.exit(0);
        }
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        Transferable tText = null;
        try {
            Robot r = new Robot();
            r.keyPress(KeyEvent.VK_ENTER);
            r.keyRelease(KeyEvent.VK_ENTER);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            r.keyPress(KeyEvent.VK_TAB);
            r.keyRelease(KeyEvent.VK_TAB);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            r.keyPress(KeyEvent.VK_A);
            r.keyRelease(KeyEvent.VK_A);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            r.keyPress(KeyEvent.VK_ENTER);
            r.keyRelease(KeyEvent.VK_ENTER);

            tText = new StringSelection("111");
            clipboard.setContents(tText, null);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            r.keyPress(KeyEvent.VK_CONTROL);
            r.keyPress(KeyEvent.VK_V);
            r.keyRelease(KeyEvent.VK_V);
            r.keyRelease(KeyEvent.VK_CONTROL);
            tText = new StringSelection("1111111");
            clipboard.setContents(tText, null);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            r.keyPress(KeyEvent.VK_CONTROL);
            r.keyPress(KeyEvent.VK_V);
            r.keyRelease(KeyEvent.VK_V);
            r.keyRelease(KeyEvent.VK_CONTROL);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            r.keyPress(KeyEvent.VK_ENTER);
            r.keyRelease(KeyEvent.VK_ENTER);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            r.keyPress(KeyEvent.VK_ENTER);
            r.keyRelease(KeyEvent.VK_ENTER);
            try {
                Thread.sleep(30000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            r.keyPress(KeyEvent.VK_ENTER);
            r.keyRelease(KeyEvent.VK_ENTER);
        } catch (AWTException e) {
            e.printStackTrace();
        }
        System.exit(0);

    }

}
//该片段来自于http://outofmemory.cn

标签:java,基础

收藏

0人收藏

支持

0

反对

0

相关聚客文章
  1. 郑 旭东 发表 2014-01-16 16:46:51 JAVA多线程和并发基础面试问答
  2. Terry Zhang 发表 2014-04-17 15:27:06 [正则] 字符类型
  3. Terry Zhang 发表 2014-04-27 10:43:29 [集合框架] 接口
  4. 逍遥冲 发表 2013-12-05 05:53:28 [引]Java NIO —- IO复用
  5. Terry Zhang 发表 2014-04-18 05:08:52 [NIO.2] 编写一个文件拷贝应用
  6. Terry Zhang 发表 2014-04-24 08:14:18 [正则] 边界匹配器
  7. Terry Zhang 发表 2014-05-03 06:33:32 [集合框架] List 接口
  8. Terry Zhang 发表 2014-05-13 06:05:01 [集合框架] SortedSet 接口
  9. 逍遥冲 发表 2013-12-30 14:13:10 [引]编译器自举和移植
  10. 糖果 发表 2015-08-03 21:33:22 逆向基础(十三) JAVA (四)
  11. 博主 发表 2013-03-12 14:17:00 Java基础学习之Enum
  12. Terry Zhang 发表 2014-04-18 05:19:53 [NIO.2] 编写一个文件移动应用

发表评论