擅长:python、mysql、java
<p>我想它可以帮助你提高jcifs ng。在</p>
<pre><code>**// Option 1 - SMB2 and SMB3:**
Properties prop = new Properties();
prop.put( "jcifs.smb.client.enableSMB2", "true");
prop.put( "jcifs.smb.client.disableSMB1", "false");
prop.put( "jcifs.traceResources", "true" );
Configuration config = new PropertyConfiguration(prop);
CIFSContext baseContext = new BaseContext(config);
CIFSContext contextWithCred = baseContext.withCredentials(new NtlmPasswordAuthentication(baseContext, domain, fileSystemInfo.getUsername(), fileSystemInfo.getPassword()));
SmbFile share = new SmbFile(fullPath.replace('\', '/'), contextWithCred);
if (!share.exists())
{
share.mkdirs();
}
share.close();
</code></pre>
<p><strong>//选项2-SMB1和CIFS:</strong></p>
^{pr2}$