到与服务器端用域用户进行身份验证:

 

try {  
            UniAddress dc 
= UniAddress.getByName("192.168.10.229");  
            jcifs.smb.NtlmPasswordAuthentication auth 
= new jcifs.smb.NtlmPasswordAuthentication(  
                    
"192.168.10.229""user""password");  
            
// jcifs.smb.SmbSession.getChallengeForDomain().  
            jcifs.smb.SmbSession.logon(dc, auth);
            System.out.print(
"OK");
      
        } 
catch (jcifs.smb.SmbAuthException e) {  
            String url 
= "domainlogin.jsp";  
            String msg 
= e.toString();  
            
// request.setAttribute("errMsg", "密码或用户名错误");  
            
// request.getRequestDispatcher(url).forward(request, response);  
            
// json="{result:0}";  
            e.printStackTrace(); 
      
        } 
catch (jcifs.smb.SmbException e) {  
            e.printStackTrace();
        } 
catch(UnknownHostException e)
        {
            e.printStackTrace();
        }

相关文章:

  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2021-12-10
  • 2021-11-23
  • 2021-10-09
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2021-09-10
  • 2021-10-24
  • 2021-11-23
  • 2021-11-05
相关资源
相似解决方案