Javascript:您可以阅读系统卷吗? [英] Javascript: Can you read the systems volume?

查看:62
本文介绍了Javascript:您可以阅读系统卷吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Java读取系统(Linux,Windows,OS/X等)卷?

Is there any way to read the System's (Linux, Windows, OS/X etc) volume with Javascript?

我不需要设置它,只需阅读它即可?

I don't need to set it, just read it?

谢谢

推荐答案

我假设您是在浏览器环境中谈论Javascript.在这种情况下,答案很明确,简短而简单:.

I'm assuming you're talking about Javascript in a browser environment. In this case, the answer is clear, short and simple: No.

客户端Javascript 不支持文件IO 操作.

但是,在某些浏览器中,您可以通过设置特定于浏览器的选项来违反该规则.例如,使用命令行参数-disable-web-security 调用基于 Webkit的浏览器,允许浏览器读取file:///c/somefolder/之类的uri. Mozilla通过编辑 user ini 以及 about:config 中的设置来提供此功能.

However, in some browsers you can breach that rule by setting browser specific options. For instance, calling a Webkit based browser with the command-line argument --disable-web-security allows the browser to read a uri like file:///c/somefolder/. Mozilla offers this possibilty by editing the user ini plus a setting in about:config.

更新

我猜deceze的评论是正确的,您的意思是音量".在这种情况下,您可以忘记上面的文字,但答案仍然是.没有本机Javascript界面​​可以获取和/或设置这种操作系统设置.

I guess deceze's comment is correct and you really mean the "sound volume". In that case you can forget about the above text, but the answer is again no. There is no native Javascript interface to get and/or set that kind of OS setting.

这篇关于Javascript:您可以阅读系统卷吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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