如何设置默认路径来保存下载的文件? [英] How can I set the default path to save downloaded file?
本文介绍了如何设置默认路径来保存下载的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们如何在系统中设置默认路径以使用Java程序将下载的文件保存在Internet Explorer的文件下载"对话框中?
How can we set a default path in our system to save a downloaded file in the "File Download" dialog box of Internet Explorer using a java program?
推荐答案
可以通过设置以下注册表项来更改默认的下载目录:
You can change the default download directory by setting this registry key:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Download Directory
要使用Java写入Windows注册表,可以使用"reg"命令. (在命令提示符下键入"reg/?"以获取有关参数的详细信息):
To write to the windows registry using Java you can either use the "reg" command. (type "reg /?" at a command prompt for details of the arguments):
Runtime.getRuntime().exec("reg [Your arguments]");
或者您可以使用第三方注册库,例如 jRegistryKey [ ^ ]
Or you can use a 3rd party registry library like jRegistryKey[^]
这篇关于如何设置默认路径来保存下载的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文