📄 testauth.java
字号:
package jndi;/* 曾海 2003-10-1测试ldap server支持的加密服务*/import javax.naming.*;import javax.naming.directory.*;import java.util.*;public class TestAuth { public TestAuth() { try{ DirContext ctx = new InitialDirContext(); Attributes attrs = ctx.getAttributes( "ldap://localhost:50028", new String[]{"supportedSASLMechanisms"}); Enumeration enu = attrs.getAll() ; while(enu!=null && enu.hasMoreElements() ){ Attribute atr = (Attribute) enu.nextElement(); System.err.println("服务器,端口50028属性是"+ atr ); Enumeration ne = atr.getAll() ; while(ne!=null && ne.hasMoreElements() ) System.err.println(" = "+ne.nextElement() ); } ctx.close() ; }catch(Exception e ) {System.err.println("出现意外"); System.exit(1);}; } public static void main(String[] args) { TestAuth testAuth1 = new TestAuth(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -