Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从另一台主机读取图像,但失败了。这是我尝试过的:
ImageIO.read(new File("http://199.231.95.45:8081/images/bg.png"));
我怎样才能做到这一点?甚至可能吗?
AFile是对文件系统(或网络驱动器)上的本地文件的引用,它与 Web 服务器上的资源无关。
File
URL改为使用
URL
ImageIO.read(new URL("http://199.231.95.45:8081/images/bg.png"));