Java LDAPÓû§ÃÜÂëÑéÖ¤
µ½http://download.csdn.net/source/1781441ÏÂÔØJLDAP.jarÎļþ
ÑéÖ¤´úÂë¶ÎÈçÏ£º
DirContext ctx = null;
String account = "aa"; //̞
String password = "123"; //µÇ¼ÃÜÂë
String root = "dc=scut,dc=edu,dc=cn"; // root
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://10.10.10.10:389/" + root);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, account+"@xxx.com" );
env.put(Context.SECURITY_CREDENTIALS, password);
try {
// Á´½Óldap
ctx = new InitialDirContext(env);
JOptionPane.showMessageDialog(this, "ÈÏÖ¤³É¹¦");
System.out.println("ÈÏÖ¤³É¹¦");
} catch (javax.naming.AuthenticationException e) {
JOptionPane.showMessageDialog(this, "ÈÏ֤ʧ°Ü");
System.out.println("ÈÏ֤ʧ°Ü");
} catch (Exception e) {
JOptionPane.showMessageDialog(this, "ÈÏÖ¤³ö´í");
System.out.println("ÈÏÖ¤³ö´í£º");
e.printStackTrace();
}
Ïà¹ØÎĵµ£º
Vector : »ùÓÚArrayµÄList£¬Æäʵ¾ÍÊÇ·â×°ÁËArrayËù²»¾ß±¸µÄһЩ¹¦ÄÜ·½±ãÎÒÃÇʹÓã¬Ëü²»¿ÉÄÜ×ßÈëArrayµÄÏÞÖÆ¡£ÐÔÄÜÒ²¾Í²»¿ÉÄÜ
³¬Ô½Array¡£ËùÒÔ£¬ÔÚ¿ÉÄܵÄÇé¿öÏ£¬ÎÒÃÇÒª¶àÔËÓÃArray¡£ÁíÍâºÜÖØÒªµÄÒ»µã¾ÍÊÇVector“sychronized”µÄ£¬Õâ¸öÒ²ÊÇVectorºÍ
ArrayListµÄΨһµÄÇø±ð¡£
ArrayList£ºÍ¬VectorÒ»ÑùÊÇÒ»¸ö»ùÓ ......
³ö´¦£ºÀ´Ô´ÓÚCSDN ZangXT´óϺ¶Ôijƪ¹ØÓÚjavaÖÐÕ»Óë¶ÑµÄÎÄÕµĻظ´
´óÌå·ÖÎöÒ»ÏÂ
1. Õ»(stack)Óë¶Ñ(heap)¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
//Õ»¶¼ÊÇÓÉÔËÐл·¾³À´´¦ÀíµÄ£¬Õâµã£Ã£«£«ºÍ£ê£á£ö£áûÓÐʲô²»Í¬£®¶ÔÓڶѣ¬²»¹ý£ê£á£ö£á¶àÁ˸ö£Ç£Ã£®
2.͉˕ ......
/*ÏÈ°ÑÏÂÔصÄÎļþ·ÅÔÚUpdateTempÎļþ¼ÐÖУ¬´ýÈ«²¿ÏÂÔغó£¬ÔÙ°Ñ´ËÎļþ¼ÐÖеÄÎļþÒƳöÌæ»»¾ÉÎļþ*/
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
......
Ê÷ÊÇÒ»¸öµÝ¹éµÄÊý¾Ý½á¹¹£¬Ò»¿ÃÊ÷ÉϵÄËùÓнڵ㶼¿ÉÒÔ±»¿´³ÉÊÇÒ»¿ÃÊ÷£¬Ö»²»¹ý³ý¸ù½ÚµãÍâÆäËû½Úµã¶¼±È×ÜÊ÷µÄ¹æģСµã¶øÒÑ¡£Ê÷µÄ½ÚµãÓÐÈýÖÖ£º¸ù½Úµã£¨Ã»Óи¸Ç׽ڵ㣩£¬Ò¶×ӽڵ㣨ûÓк¢×ӽڵ㣩£¬Ò»°ã½Úµã£¨¼ÈÓи¸Ç׽ڵ㣬ҲÓк¢×ӽڵ㣩¡£¾ßÌå¶Ô½á¹¹µÄ·ÖÎö£¬¼¸ºõËùÓÐдÊý¾Ý½á¹¹µÄÊéÖж¼ÓÐÌáµ½¡£
Õâ¿ÃÊ÷µÄʵÏÖ»¨Á˺ü¸Ììʱ¼ä£¬ ......
µ½http://download.csdn.net/source/1781433ÏÂÔØjxl.jarÎļþ
/*TitleÊDZ£´æ³öÀ´µÄÎļþÃû£¬gbl_LastOpenPathÓÃÓڼǼÉϴδò¿ªµÄ·¾¶*/
public void ExportToExcel(JTable table, String Title){
File DefaultFile;
JFileChooser fc = new JFileChooser();
File file;
if(gbl_LastOpen ......