Java 我的JApplet可以';无法写入我的APPDATA文件夹
是的,我正在制作一个基于文本的RPG,以小程序的形式。打开时,此小程序将写入APPDATA目录。它在IDE中工作,但当我在Firefox中尝试时,它会出现一条错误消息。是链接Java 我的JApplet可以';无法写入我的APPDATA文件夹,java,access-denied,appdata,japplet,Java,Access Denied,Appdata,Japplet,是的,我正在制作一个基于文本的RPG,以小程序的形式。打开时,此小程序将写入APPDATA目录。它在IDE中工作,但当我在Firefox中尝试时,它会出现一条错误消息。是链接 File otherWorldDirectory = new File(System.getenv("APPDATA") + "\\.otherWorld"); if (!otherWorldDirectory.exists()) { //Adding the folder .otherWorld to the
File otherWorldDirectory = new File(System.getenv("APPDATA") + "\\.otherWorld");
if (!otherWorldDirectory.exists()) {
//Adding the folder .otherWorld to the APPDATA
otherWorldDirectory.mkdir();
System.out.println("Directory '.otherWorld' created.");
} else {
//The folder .otherWorld already exists.
System.out.println("Directory '.otherWorld' is not created, it exists.");
}
这就是小程序的要点。除非他们“受信任”,否则他们无法访问用户的磁盘。您必须对小程序进行签名才能访问用户的磁盘。这就是小程序的要点。除非他们“受信任”,否则他们无法访问用户的磁盘。您必须对小程序进行签名才能访问用户的磁盘 打开时,此小程序将写入APPDATA目录 不要那样做。苹果公司*nix机器将没有它,applet可以访问多种形式的持久性,即x-plat
- 沙盒
- 饼干
- JNLPAPI
,如图所示PersistenceService
- 信任
作为存储信息的x平台位置user.home
首选项
- 所有方式都向沙盒应用程序开放
- 沙盒
- 饼干
- JNLPAPI
,如图所示PersistenceService
- 信任
作为存储信息的x平台位置user.home
首选项
- 所有方式都向沙盒应用程序开放