标签:style blog io ar color os sp java on
import java.io.*; public class dd { public static void main(String[] args) { try { Process pro = Runtime.getRuntime().exec( "cmd.exe /c tasklist |find \"1.exe\""); BufferedReader reader=new BufferedReader(new InputStreamReader(pro.getInputStream())); String str=reader.readLine(); if (str!=null) { System.out.println("1.exe在运行"); }else{ System.out.println("1.exe没有在运行"); } reader.close(); } catch (IOException ex) { } } }
标签:style blog io ar color os sp java on
原文地址:http://www.cnblogs.com/zyp307/p/9801a2e5b4bec9eaba033e808b4ab87d.html