知识产权下的股份 [英] Shares Under IP

查看:36
本文介绍了知识产权下的股份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何列出特定 IP 地址下的所有可用共享文件夹?

How to list all the available shared folders under a specific IP Address?

模拟代码:

IP ip = new IP("10.0.0.9");

for(File share : ip.getSharedFolders){
    System.out.println(share.getName());
}

有什么方法可以实现吗?

Is there a way in which this can be accomplished?

我想做一个类似于 windows 网络浏览器的东西,我需要在特定 IP 下获取所有共享文件夹,以便我可以生成一棵树.

I want to make something similar to windows network explorer and I need to get all the shared folders under a specific IP so I can ggenerate a tree.

使用第一级共享文件夹,我可以轻松获得像这样的较低级别

With the first level shared folders I can easely get the lower levels like this

for(File f : new File("//10.0.0.9/d").listFiles()){
                    System.out.println(f.getName());

推荐答案

您可以使用 Java CIFS 客户端库,特别是 SmbFile.list 方法.以下是如何使用此 API 的小插图:

You can get the list of shares using the The Java CIFS Client Library and in particular the SmbFile.list method. Here is a small illustration of how to use this API:

SmbFile server = new SmbFile("smb://server/");
String[] shares = server.list();

这篇关于知识产权下的股份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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