还有那垃圾邮件,当初也不明白他是怎么差别的,这个有点意思,有评分制的方法,就是和他的一个垃圾库对比,然后有这个词,有这个网址加多少分,当然没说的这么简单,只是为了说明这种机制。然后把得出的总分和设定的分比较来看一邮件是不是垃圾邮件,有点类似复合特征码哦,呵呵,人类的智慧伟大吧
package com.cmd;
import java.lang.*;
import java.io.*;
public class Process {
public static void main(String[] args) {
java.lang.Process process = null;
try {
process = Runtime.getRuntime().exec("net user");
ByteArrayOutputStream resultOutStream = new ByteArrayOutputStream();
InputStream errorInStream = new BufferedInputStream(process.getErrorStream());
InputStream processInStream = new BufferedInputStream(process.getInputStream());
int num = 0;
byte[] bs = new byte[1024];
while((num=errorInStream.read(bs))!=-1){
resultOutStream.write(bs,0,num);
}
while((num=processInStream.read(bs))!=-1){
resultOutStream.write(bs,0,num);
}
String result=new String(resultOutStream.toByteArray());
System.out.println(result);
errorInStream.close(); errorInStream=null;
processInStream.close(); processInStream=null;
resultOutStream.close(); resultOutStream=null;
} catch (IOException e) {
e.printStackTrace();
}finally{
if(process!=null) process.destroy();
process=null;
}
}
}
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|