connecting to shared folder in windows with java

后端 未结 2 1231
夕颜
夕颜 2020-11-28 07:19

I need to connect to a shared folder on a remote windows machine through java , where i put my domain authentication (username and password ) in the code , here is my code

2条回答
  •  臣服心动
    2020-11-28 07:52

    If you are accessing open shared folders (i.e. username or password are not known or required),then you can follow the code below :

    String path="smb://172.16.0.11/";
    
    SmbFile smbFile = new SmbFile(path);
    String a[]=smbFile.list();
    for(int i=0;i

提交回复
热议问题