a che servono le istruzioni INUSER e INTERN???
a che servono le istruzioni INUSER e INTERN???
- Ma7u -
Sysadmin.it
Forum Moderator
sono metodi di una qualche tua classe?
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() !
- Ma7u -
Sysadmin.it
Forum Moderator
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 !
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.
![]()
si èprorpio quello!!!
ora spero di trovarla...
ma è in chiaro nel codice?
- Ma7u -
Sysadmin.it
Forum Moderator
trovata!!! thx
- Ma7u -
Sysadmin.it
Forum Moderator
Ok.. visto che alla fine era lì ?? :-)
Divertiti col 5 !!!
Ciao !