ÈçºÎ»ñÈ¡javaÀàÖеıäÁ¿ÃûµÄ×Ö´®
ÔÚÀàÖж¨ÒåÁËÒ»¸öÊôÐÔabc£¬ÈçºÎ»ñÈ¡Õâ¸ö±äÁ¿µÄabcµÄÃû×Ö´®ÄØ£¿Ò²¾ÍÊÇ˵Ôõô֪µÀabcÕâ¸ö±äÁ¿µÄÃû×ÖÊÇabc£¬Õâ¸öÎÊÌâ±È½ÏµÄºÃÍæ¡£
Õâ¸öÊÇżÔÚÒ»¿ª·¢ÖÐÓöµ½µÄÒ»¸ö±È½ÏÓÐȤµÄÎÊÌ⣬ÕÒ ÁË°ëÌìµÄ×ÊÁϼÓÏÂżÐÁÇÚµÄ˼¿¼£¬ÖÕÓÚÕÒµ½µÄ½â¾ö·½·¨¡£Ó÷´Éä¡«¡«¡«
javaÌṩÁ˺ÜÇ¿´óµÄ·´Éä»úÖÆ£¬¿ÉÒÔ˵±È¶¯Ì¬ÓïÑÔ»¹¶¯Ì¬¡£µ«ÊÇÕâ¸ö¶«¶«Æ½Ê±µÄÓ¦Óò»ÊǺܶàµÄ˵¡£
ÏÖÌṩһ¸ö¿ÉÒÔ¶¯Ì¬»ñÈ¡¶ÔÏóÖеıäÁ¿µÄ±äÁ¿Ãû³ÆµÄ·½·¨£º
public class MyTools {
public static void setAllComponentsName(Object f) {
// »ñÈ¡f¶ÔÏó¶ÔÓ¦ÀàÖеÄËùÓÐÊôÐÔÓò
Field[] fields = f.getClass().getDeclaredFields();
for(int i = 0 , len = fields.length; i < len; i++) {
// ¶ÔÓÚÿ¸öÊôÐÔ£¬»ñÈ¡ÊôÐÔÃû
String varName = fields[i].getName();
try {
// »ñÈ¡ÔÀ´µÄ·ÃÎÊ¿ØÖÆȨÏÞ
boolean accessFlag = fields[i].isAccessible();
// Ð޸ķÃÎÊ¿ØÖÆȨÏÞ
fields[i].setAccessible(true);
// »ñÈ¡ÔÚ¶ÔÏófÖÐÊôÐÔfields[i]¶ÔÓ¦µÄ¶ÔÏóÖеıäÁ¿
Object o = fields[i].get(f);
System.out.println("´«ÈëµÄ¶ÔÏóÖаüº¬Ò»¸öÈçϵıäÁ¿£º" + varName + " = " + o);
// »Ö¸´·ÃÎÊ¿ØÖÆȨÏÞ
fields[i].setAccessible(accessFlag);
} catch (IllegalArgumentException ex) {
ex.printStackTrace();
} catch (IllegalAccessException ex) {
ex.printStackTrace();
}
}
}
public static void main(String[] args)
{
// ²âÊÔ´úÂëÓÃÀ´»ñÈ¡Ò»¸öJLabelÖÐÉùÃûµÄËùÓеÄÊôÐÔÃûºÍÆäÊôÐÔ±äÁ¿
setAllComponentsName(new JLabel("²âÊÔ"));
}
}
fields[i].setAccessible(true);Õâ¾äÖ÷ÒªÊÇÒòΪ˽ÓеıäÁ¿ÔÚ¶ÔÏóÍâÊÇÎÞ·¨·ÃÎʵģ¬Í¨¹ýÕâ¸öÉèÖþͿÉÒԸıä˽ÓбäÁ¿µÄ·ÃÎÊȨ£¬»¹ÕæµÄÓеã¿Ö²À£¬µ±Å¼°ÑÕâ¸ö½â¾ö·½·¨¸æËßBossµÄʱºò£¬Boss²îµãÍÂѪ£¬Ë½ÓеĶ¼ÄÜ·ÃÎÊÁË£¬»¹ÓÐʲô°²È«¿ÉÑÔ£¿
²»¹ýÁË£¬Óа²È«¾ÍÓÐÌØȨ£¬ËùÒÔÓÉÓÚÄܺܺõĽâ¾öÎÊÌ⻹ÊDZ»²ÉÄÉÁË£¬ÎûÎû¡«¡«¡«
Object o = fields[i].get(f);Õâ¾äµÄ×÷ÓþÍÊÇÈ¡µÃ´«Èë¶ÔÏófÖÐÀàµÄÊôÐ
Ïà¹ØÎĵµ£º
Java ºÍ C#µÄ±È½Ï
1¡£·ÃÎÊ¿ØÖÆ·½Ã棺C#ÓÐpublic¡¢internal¡¢protected¡¢private£¬±Èjava¶àÁ˸öinternal£¬ÆäʵËü¸újavaµÄ°ü·ÃÎʲ¶à£¬internal±íʾͬһ¸ö±àÒ뼯ºÏ£¨Èçexe¡¢dll£©ÏµÄÀà¿ÉÒÔ»¥·Ã¡£
¶ÔÓÚprotected£¬javaºÍC#ÓÐÇø±ð¡£ÔÚjavaÖУ¬protectedºÍ°ü·ÃÎʼ¶±ð²î²»¶à£¬¼´²»ÊÇ˽Óеġ£¶øÔÚC#ÖУ¬protectedºÍpriv ......
Ò»¡¢Ê×ÏÈÀ´¿´Ò»ÏÂhttpµÄ±¨ÎĽṹ
1¡¢ÇëÇó±¨ÎÄ
Ò»¸öHTTPÇëÇó±¨ÎÄÓÉÇëÇóÐУ¨request line£©¡¢ÇëÇóÍ·²¿£¨header£©¡¢¿ÕÐкÍÇëÇóÊý¾Ý4¸ö²¿·Ö×é³É£¬ÏÂͼ¸ø³öÁËÇëÇó±¨ÎĵÄÒ»°ã¸ñʽ¡£
(1)ÇëÇóÐÐ
ÇëÇóÐÐÓÉÇëÇó·½·¨×ֶΡ¢URL×ֶκÍHTTPÐÒé°æ±¾×Ö¶Î3¸ö×Ö¶Î×é³É£¬ËüÃÇÓÿոñ·Ö¸ô¡£ÀýÈ磬GET /index.html HTTP/1.1¡£
HTTPÐÒéµÄÇëÇ ......
ΪÁËʹ²Ù×÷ϵͳ֧³ÖJava£¬¿ÉÓÉSun¹«Ë¾µÄJavaÏÂÔØÍøÒ³, ¸ù¾Ý²Ù×÷ϵͳÀàÐÍÏÂÔغͰ²×°Ò»¸öÃâ·ÑJRE(Java Runtime Environment), ÀýÈç, JRE6¡£È»ºó, ½«±¾ÎļþÏÂÔر£´æ, ¿½±´, ²¢Õ³Ìùµ½JREËùÔÚµÄsecurityĿ¼, ÀýÈç, C:/Program Files/Java/jre6/lib/security/, Ìæ»»ÔÓеÄÎļþjava.policy, ÉèÖÃJREÍê³É¡£
......
JAVA´úÂë±àÒëºóÊÇ.classÎļþ,ͨ¹ý·´±à¹¤¾ßºÜÈÝÒ×±»±ðÈË¿´µ½Ô´´úÂë
±£»¤JAVA´úÂëµÄ·½·¨ºÜ¶à£¬ÏÂÃæ½éÉÜÒ»ÖֱȽϷ½±ãʹÓõķ½·¨¡£
obfuscate4eÊÇÒ»¿î²ÉÓûìÏýÆ÷¸Ä±äCLASSÎļþÄÚÈݵķ½·¨¡£
ÏÂÎĽ«½éÉܾßÌåºÍeclipseµÄÕûºÏ·½·¨
1.ÏÂÔØobfuscate4e,¼ÓÈëÕ¾µãhttp://obfuscate4e.org/updates/,Õâ¸öÈí¼þÊǵ¹úÈË¿ª· ......