PDA

Visualizza la versione completa : java


Mago7
15-07-2002, 11:06
a che servono le istruzioni INUSER e INTERN???

Mandrake978
15-07-2002, 11:35
Di quale classe ???

Maldito
15-07-2002, 11:37
sono metodi di una qualche tua classe?

Mago7
15-07-2002, 11:37
spero ti sia d'aiuto!


import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.EventObject;

public class PasswdLevel4 extends Applet
implements ActionListener
{

public PasswdLevel4()
{
inuser = new String[22];
totno = 0;
countConn = null;
countData = null;
inURL = null;
txtlogin = new TextField();
label1 = new Label();
label2 = new Label();
label3 = new Label();
txtpass = new TextField();
lblstatus = new Label();
ButOk = new Button();
ButReset = new Button();
lbltitle = new Label();
}

void ButOk_ActionPerformed(ActionEvent actionevent)
{
boolean flag = false;
for(int i = 1; i <= totno / 2; i++)
if(txtlogin.getText().trim().toUpperCase().intern( ) != inuser[2 * (i - 1) + 2].trim().toUpperCase().intern() && txtpass.getText().trim().toUpperCase().intern() !

Mandrake978
15-07-2002, 11:43
Se per caso il livello 4 di Try2Hack.. devi andare pi in basso a leggere.. quando scoprirai la password vedrai che ti mangerai le mani, ce l'hai l a portata di mano !
Se non quello che penso.. sorry !

Maldito
15-07-2002, 11:45
allora:

inuser un'0array di stringhe che ti crei tu.

intern() un metodo della classe String,

da documentazione :

intern
public native String intern()
Returns a canonical representation for the string object.
A pool of strings, initially empty, is maintained privately by the class String.

When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a reference to this String object is returned.

It follows that for any two strings s and t, s.intern() == t.intern() is true if and only if s.equals(t) is true.

All literal strings and string-valued constant expressions are interned. String literals are defined in 3.10.5 of the Java Language Specification


Returns:
a string that has the same contents as this string, but is guaranteed to be from a pool of unique strings.



:ciauz:

Mago7
15-07-2002, 11:47
si prorpio quello!!!

ora spero di trovarla...
ma in chiaro nel codice?

Mago7
15-07-2002, 11:48
trovata!!! thx

Mandrake978
15-07-2002, 11:55
Ok.. visto che alla fine era l ?? :-)
Divertiti col 5 !!!
Ciao !

Loading