如何在另一个 Windows 服务器中创建文件?服务器有用户名、密码、IP 地址和特定目录。
最佳答案
SAMBA !巴西IIIIII,巴西IIIIIIIII!
类似这样的事情:
String userPass = "username:password";
String filePath = "smb://ip_address/shared_folder/file_name";
NtlmPasswordAuthentication authentication = new NtlmPasswordAuthentication(userPass);
SmbFile smbFile = new SmbFile(filePath, authentication);
SmbFileOutputStream smbFileOutputStream = new SmbFileOutputStream(smbFile);
PrintStream printStream = new PrintStream(smbFileOutputStream);
//You should be good from this point on...
注意:需要首先共享目标文件夹!
关于java - 在另一台服务器上创建文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7477542/