|
Determining the host from where the Applet is loaded |
|
|
You can determine the host from where an Applet is loaded using getCodeBase() method.
An example usage is implementing a simple copy protection scheme. If the retrieved codebase does not equal
to your predefined host then you can quit.
import java.applet.*;
public class MyApplet extends Applet {
public void init() {
System.out.println(getCodeBase());
//
// you can check the value of getCodeBase()
// to implements a simple copy protection
// scheme. If it's not equals to your
// URL then quit.
//
}
}
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.