[英]My JApplet can't write to my APPDATA folder
是的,我正在以小程序的形式制作基于文本的RPG。 打开后,此小程序将写入您的APPDATA目录。 它可以在IDE中运行,但是当我在Firefox中尝试时,它会显示一条错误消息。 这里是链接。
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.");
}
这是小程序的重点。 除非它们是“受信任的”,否则它们无法访问用户的磁盘。 您必须对小程序签名才能访问用户的磁盘。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.