evo resenja
prosto...
Code:
private static String getMac(String dataToEncrypt)
{
Runtime runtime = Runtime.getRuntime();
Process process = null;
String mac = "";
String command = "get_md5.exe " + dataToEncrypt;
try {
process = runtime.exec(command);
BufferedReader inBuff = new BufferedReader(new InputStreamReader(process.getInputStream()));
//InputStream inst = new BufferedInputStream();
process.getInputStream();
DataInputStream in = new DataInputStream(process.getInputStream());
// Read and print the output
String line = null;
while ((line = inBuff.readLine()) != null) {
System.out.println(line);
mac = line;
}
/*out.println("<HTML>\n" +
"<HEAD><TITLE>" + "title" + "</TITLE></HEAD>\n" +
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1 ALIGN=CENTER>" + "title" + "</H1>\n" +
"<TABLE BORDER=1 ALIGN=CENTER>\n" +
"<TR BGCOLOR=\"#FFAD00\">\n" +
"</table></body></html>");*/
}
catch (Exception e) {
e.printStackTrace();
}
return mac;
}