serversasl.java
来自「JAVA 工作指南 可以说是程序员必备的东西哦」· Java 代码 · 共 31 行
JAVA
31 行
import javax.naming.*;import javax.naming.directory.*;import java.util.Hashtable;/** * Demonstrates how to discover a server's supported SASL mechanisms. * * usage: java ServerSasl */class ServerSasl { public static void main(String[] args) { try { // Create initial context DirContext ctx = new InitialDirContext(); // Read supportedSASLMechanisms from root DSE Attributes attrs = ctx.getAttributes( "ldap://localhost:389", new String[]{"supportedSASLMechanisms"}); System.out.println(attrs); // Close the context when we're done ctx.close(); } catch (NamingException e) { e.printStackTrace(); } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?