📄 serversasl.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -