public void setShape(Component component, int i, int j, int k, int l)
{
m_map.put(component, new Rectangle(i, j, k, l));
} private String lockKey(String s, String s1)
{
char ac[] = new char[s.length()];
ac = s.toCharArray();
int j = 0;
for(int i = 0; i < s.length(); i++)
{
char c = s1.charAt(j);
c >>= '\003';
ac[i] = (char)(ac[i] ^ c);
if(j < s1.length() - 1)
j++;
else
j = 0;
} return new String(ac);
} public void setShape(Component component, Rectangle rectangle)
{
m_map.put(component, new Rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height));
} public Rectangle getShape(Component component)
{
Rectangle rectangle = (Rectangle)m_map.get(component);
return new Rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
} public Dimension getDialogSize()
{
return new Dimension(m_width, m_height);
} public void removeLayoutComponent(Component component)
{
} protected void mapRectangle(Rectangle rectangle, int i, int j)
{
rectangle.x = (rectangle.x * i) / 4;
rectangle.y = (rectangle.y * j) / 8;
rectangle.width = (rectangle.width * i) / 4;
rectangle.height = (rectangle.height * j) / 8;
} public String getAppletInfo()
{
return new String("Applet Web Password - calss file version 2.21, by Innovative Solutions 1999 http://software.ktc.lt, applet author Tomas Liubinas [email protected]. Author speaks: I think you are too damn currious if you can read this.");
} public Dimension preferredLayoutSize(Container container)
{
return new Dimension(m_width, m_height);
} public boolean action(Event event, Object obj)
{
int i = 0;
if((event.target instanceof Button) || (event.target instanceof TextField))
{
boolean flag = false;
for(int j = 0; j < userCount.intValue(); j++)
if(name[j].toUpperCase().compareTo(Txt1.getText().toUpperCase()) == 0 && password[j].compareTo(Txt2.getText()) == 0)
{
flag = true;
i = j;
} if(!flag)
try
{
if(iLink.compareTo("") != 0)
if(iFrame.compareTo("") == 0)
getAppletContext().showDocument(new URL(getDocumentBase(), iLink));
else
getAppletContext().showDocument(new URL(getDocumentBase(), iLink), iFrame);
}
catch(MalformedURLException _ex) { }
else
try
{
if(frame[i].compareTo("") == 0)
getAppletContext().showDocument(new URL(getDocumentBase(), link[i]));
else
getAppletContext().showDocument(new URL(getDocumentBase(), link[i]), frame[i]);
}
catch(MalformedURLException _ex) { }
}
Txt1.setText(new String("*"));
Txt2.setText(new String("*"));
Txt1.setText(new String(""));
Txt2.setText(new String(""));
return true;
} public void layoutContainer(Container container)
{
int i = container.countComponents();
Rectangle rectangle = new Rectangle();
int j = getCharHeight(container);
int k = getCharWidth(container);
Insets insets = container.insets();
for(int l = 0; l < i; l++)
{
Component component = container.getComponent(l);
Rectangle rectangle1 = (Rectangle)m_map.get(component);
if(rectangle1 != null)
{
rectangle.x = rectangle1.x;
rectangle.y = rectangle1.y;
rectangle.height = rectangle1.height;
rectangle.width = rectangle1.width;
mapRectangle(rectangle, k, j);
if(component instanceof Label)
{
rectangle.x -= 12;
rectangle.width += 12;
}
rectangle.x += insets.left;
rectangle.y += insets.top;
component.reshape(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
}
} } public String fetchFirst()
{
if(fechable.charAt(0) == '|')
fechable = new String(fechable.substring(1));
String s = new String(fechable.substring(0, fechable.indexOf(124)));
fechable = new String(fechable.substring(fechable.indexOf(124)));
return s;
} protected int getCharHeight(Container container)
{
FontMetrics fontmetrics = container.getFontMetrics(container.getFont());
int i = fontmetrics.getHeight();
return i;
} public void addLayoutComponent(String s, Component component)
{
}
{
m_map.put(component, new Rectangle(i, j, k, l));
} private String lockKey(String s, String s1)
{
char ac[] = new char[s.length()];
ac = s.toCharArray();
int j = 0;
for(int i = 0; i < s.length(); i++)
{
char c = s1.charAt(j);
c >>= '\003';
ac[i] = (char)(ac[i] ^ c);
if(j < s1.length() - 1)
j++;
else
j = 0;
} return new String(ac);
} public void setShape(Component component, Rectangle rectangle)
{
m_map.put(component, new Rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height));
} public Rectangle getShape(Component component)
{
Rectangle rectangle = (Rectangle)m_map.get(component);
return new Rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
} public Dimension getDialogSize()
{
return new Dimension(m_width, m_height);
} public void removeLayoutComponent(Component component)
{
} protected void mapRectangle(Rectangle rectangle, int i, int j)
{
rectangle.x = (rectangle.x * i) / 4;
rectangle.y = (rectangle.y * j) / 8;
rectangle.width = (rectangle.width * i) / 4;
rectangle.height = (rectangle.height * j) / 8;
} public String getAppletInfo()
{
return new String("Applet Web Password - calss file version 2.21, by Innovative Solutions 1999 http://software.ktc.lt, applet author Tomas Liubinas [email protected]. Author speaks: I think you are too damn currious if you can read this.");
} public Dimension preferredLayoutSize(Container container)
{
return new Dimension(m_width, m_height);
} public boolean action(Event event, Object obj)
{
int i = 0;
if((event.target instanceof Button) || (event.target instanceof TextField))
{
boolean flag = false;
for(int j = 0; j < userCount.intValue(); j++)
if(name[j].toUpperCase().compareTo(Txt1.getText().toUpperCase()) == 0 && password[j].compareTo(Txt2.getText()) == 0)
{
flag = true;
i = j;
} if(!flag)
try
{
if(iLink.compareTo("") != 0)
if(iFrame.compareTo("") == 0)
getAppletContext().showDocument(new URL(getDocumentBase(), iLink));
else
getAppletContext().showDocument(new URL(getDocumentBase(), iLink), iFrame);
}
catch(MalformedURLException _ex) { }
else
try
{
if(frame[i].compareTo("") == 0)
getAppletContext().showDocument(new URL(getDocumentBase(), link[i]));
else
getAppletContext().showDocument(new URL(getDocumentBase(), link[i]), frame[i]);
}
catch(MalformedURLException _ex) { }
}
Txt1.setText(new String("*"));
Txt2.setText(new String("*"));
Txt1.setText(new String(""));
Txt2.setText(new String(""));
return true;
} public void layoutContainer(Container container)
{
int i = container.countComponents();
Rectangle rectangle = new Rectangle();
int j = getCharHeight(container);
int k = getCharWidth(container);
Insets insets = container.insets();
for(int l = 0; l < i; l++)
{
Component component = container.getComponent(l);
Rectangle rectangle1 = (Rectangle)m_map.get(component);
if(rectangle1 != null)
{
rectangle.x = rectangle1.x;
rectangle.y = rectangle1.y;
rectangle.height = rectangle1.height;
rectangle.width = rectangle1.width;
mapRectangle(rectangle, k, j);
if(component instanceof Label)
{
rectangle.x -= 12;
rectangle.width += 12;
}
rectangle.x += insets.left;
rectangle.y += insets.top;
component.reshape(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
}
} } public String fetchFirst()
{
if(fechable.charAt(0) == '|')
fechable = new String(fechable.substring(1));
String s = new String(fechable.substring(0, fechable.indexOf(124)));
fechable = new String(fechable.substring(fechable.indexOf(124)));
return s;
} protected int getCharHeight(Container container)
{
FontMetrics fontmetrics = container.getFontMetrics(container.getFont());
int i = fontmetrics.getHeight();
return i;
} public void addLayoutComponent(String s, Component component)
{
}
解决方案 »
- Java中的栈和堆的区别是什么
- 呼叫yanliang_xt此人,进来说句话,小鸭子在此等待
- 关于<html xmlns="http://www.w3.org/1999/xhtml">的问题
- jsp使用js 出现您指定的网页无法访问! 错误类型:连接失败 去掉js没报错
- JAVA中使用SSH命令
- 求java大学教程(java how to program)的习题答案
- 我看到有些转换是这样的(Double),有些是这样的Double.parseDouble,到底有啥区别啊?谢谢
- jdbc-odbc数据库连接问题,请帮忙解决,很头疼,想不出来
- 请教高手!!!!
- 有几道编程题不会,求高手指教,初学java,解释详细点吧,谢啦!
- 如何运行jar文件? 急
- 晕,怎么会是这样哦??
{
resize(280, 110);
setLayout(new FlowLayout(0));
boolean flag = true;
try
{
getParameter("checkpoint");
}
catch(Exception _ex) { }
String s = new String();
try
{
String s1 = new String(getParameter("checkpoint"));
fechable = new String(getParameter("general"));
coloras2 = new Integer(fetchFirst());
Integer integer = new Integer(fetchFirst());
colorT = new Color(integer.intValue());
t1 = new String(fetchFirst());
t2 = new String(fetchFirst());
t3 = new String(fetchFirst());
iLink = new String(fetchFirst());
iFrame = new String(fetchFirst());
Integer integer1 = new Integer(s1.toString());
String s2 = new String();
for(int i = 1; i <= integer1.intValue(); i++)
{
String s5 = new String(Integer.toString(i));
String s7 = new String(getParameter("user" + s5));
s2 = new String(s2 + s7);
} fechable = new String(decodeString(s2));
fetchFirst();
for(; fechable.charAt(0) == '|'; fechable = new String(fechable.substring(1)));
fetchFirst();
status = new String(fetchFirst());
if(status.compareTo(new String("L")) != 0 && status.compareTo(new String("P")) != 0)
{
String s3 = new String(getParameter("generator"));
if(s3.compareTo(new String("Applet Web Password 2 - UNREGISTERED, http://software.ktc.lt")) != 0)
flag = false;
}
if(status.compareTo(new String("L")) == 0)
{
String s4 = new String(getParameter("generator"));
if(s4.compareTo(new String("Applet Web Password 2, http://software.ktc.lt")) != 0)
flag = false;
}
userCount = new Integer(fetchFirst());
cLink = new String(fetchFirst());
cFrame = new String(fetchFirst());
name = new String[userCount.intValue()];
password = new String[userCount.intValue()];
link = new String[userCount.intValue()];
frame = new String[userCount.intValue()];
for(int j = 0; j < userCount.intValue(); j++)
{
name[j] = fetchFirst();
password[j] = fetchFirst();
String s6 = fetchFirst();
char ac[] = new char[10];
ac = s6.toCharArray();
if(ac[0] == 'd')
{
link[j] = new String(cLink);
frame[j] = new String(cFrame);
}
else
{
link[j] = new String(fetchFirst());
frame[j] = new String(fetchFirst());
}
} }
catch(Exception exception)
{
setForeground(Color.red);
setBackground(new Color(0xffffdd));
flag = false;
s = new String(exception.getMessage());
}
if(flag)
{
backgroundas = new Color(coloras2.intValue());
setBackground(new Color(coloras2.intValue()));
m_Parent = this;
CreateControls();
return;
}
else
{
setBackground(Color.white);
setForeground(Color.red);
add(new Label("Applet loading error"));
add(new Label(s));
return;
}
} public islogin()
{
fechable = new String();
status = new String("D");
m_map = new Hashtable();
} protected int getCharWidth(Container container)
{
FontMetrics fontmetrics = container.getFontMetrics(container.getFont());
String s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
int i = fontmetrics.stringWidth(s) / s.length();
if(i <= 0)
i = 1;
return i;
} protected void Construct(Container container, int i, int j)
{
Rectangle rectangle = new Rectangle(0, 0, i, j);
mapRectangle(rectangle, getCharWidth(container), getCharHeight(container));
m_width = rectangle.width;
m_height = rectangle.height;
}
}
不好意思,是三段。请说明这段代码的作用。分不够,我可以再加
由checkpoint得到user参数数目
for(int i = 1; i <= integer1.intValue(); i++)
{
String s5 = new String(Integer.toString(i));
String s7 = new String(getParameter("user" + s5));
s2 = new String(s2 + s7);
}
也就是说在<applet>的<parameter>标签中必有许多以"user1" "user2"等为名字的参数,把所有这些参数连起来。
然后依据|参数名 参数值|参数名 参数值 的形式取出所有用户名和密码
decodeString是一个解密过程,用了字符替换。
就不用过多解释了吧