1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| package newbiescontest;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ObjectInputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class Yajc2 extends Applet
implements ActionListener
{
private Button SubmitButton;
private TextField PasswordField;
private Label PasswordLabel;
private Label resultLabel;
private Object plouf;
private PloufCipher ploufCipher;
public void stop()
{
}
public Yajc2()
{
SubmitButton = null;
PasswordField = null;
PasswordLabel = null;
resultLabel = null;
plouf = null;
ploufCipher = null;
SubmitButton = new Button();
PasswordField = new TextField();
PasswordLabel = new Label();
resultLabel = new Label();
}
public void actionPerformed(ActionEvent actionevent)
{
String s = PasswordField.getText();
String s1 = getCodeBase().toString();
s1 = (new StringBuilder()).append(s1).append("plouf").toString();
try
{
URL url = new URL("http://www.newbiecontest.org/epreuves/javascript/plouf");
plouf = loadPlouf(url);
Plouf test = (Plouf) plouf;
ploufCipher = new PloufCipher(test);
public Object loadPlouf(URL url)
{
Object obj = null;
try
{
HttpURLConnection httpurlconnection = (HttpURLConnection)url.openConnection();
ObjectInputStream objectinputstream = new ObjectInputStream(httpurlconnection.getInputStream());
obj = objectinputstream.readObject();
objectinputstream.close();
httpurlconnection.disconnect();
}
catch(Exception exception)
{
exception.printStackTrace();
}
return obj;
} |