如何能一个applet读/写的本地文件系统中的文件? [英] How can an applet Read/Write files on the local file-system?

查看:129
本文介绍了如何能一个applet读/写的本地文件系统中的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在的Java JApplet的,文件读写操作没有在webrowser工作。当我点击确定按钮,它应该是写在我们的本地路径某些文件。但它显示如下错误。如何解决这个问题?

  java.security.AccessControlException:访问被拒绝(
    java.io.FilePermission中的D:/.../ HTML,写)


默认情况下

解决方案

每当一个小程序试图访问本地资源,其作为安全层的一部分拒绝。您有以下选择,如果你需要使用小程序来访问:


  1. 使用任何签名机制登录您的小程序,然后发布,


  2. 虽然这个人是不是这样做的有用的推荐方式。)更改所在的小程序执行计算机上的安全设置(请参阅http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html)

In Java JApplet, file read and write operations did not work in webrowser. When I click "Ok" button, it should be write some file in our local path. But it shows below error. How to resolve this error?

java.security.AccessControlException: access denied (
    "java.io.FilePermission" "D:/.../.html" "write")

解决方案

By default whenever a applet tries to access local resources, its denied as a part of security layer. You have following options if you need to access using applet:

  1. Sign your applet using any signing mechanism and then publish,
  2. ( though this one is not a useful and recommended way of doing this.)Change the security settings on the computer where the applet is executing (see http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html)

这篇关于如何能一个applet读/写的本地文件系统中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆