×î½üѧϰURLÌøתµÄʱºòнøÈý¸ö³¬ºÃÓõÄPHP¼ÓÃܽâÃܺ¯Êý,òËÆÊÇdiscuzÀïµÄ…ʹÓÃÕâЩ¼ÓÃܽâÃܵÄÔÒòÊÇÒòΪÓÐʱ×Ô¼ºµÄURLµØÖ·±»ÈË»ñÈ¡ÒÔºóÏëÆƽâÄãÀïÃæ´«ÖµµÄÄÚÈݾͱØÐëÖªµÀÄãµÄkey£¬Ã»ÓÐkey£¬ËûÓ¦¸ÃÒªÆÆÁËÒ»Õó×Ó²ÅÄÜÖªµÀÄãURLÀïÃæµÄÄÚÈÝ°É...
Ïл°ÉÙ˵,ÏȽ«ËüÃÇ´ò°ü³ÉÒ»¸öÎļþ¾Í½Ðfun.php°É
<?php
function passport_encrypt($txt, $key) {
srand((double)microtime() * 1000000);
$encrypt_key = md5(rand(0, 32000));
$ctr = 0;
$tmp = '';
for($i = 0;$i < strlen($txt); $i++) {
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;
$tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]);
}
return base64_encode(passport_key($tmp, $key));
}
function passport_decrypt($txt, $key) {
$txt = passport_key(base64_decode($txt), $key);
$tmp = '';
for($i = 0;$i < strlen($txt); $i++) {
$md5 = $txt[$i];
$tmp .= $txt[++$i] ^ $md5;
}
return $tmp;
}
function passport_key($txt, $encrypt_key) {
$encrypt_key = md5($encrypt_key);
$ctr = 0;
$t ......
HÎļþºÍCÎļþÔõôÓÃÄØ£¿Ò»°ãÀ´Ëµ£¬HÎļþÖÐÊÇdeclare£¨ÉùÃ÷£©£¬CÎļþÖÐÊÇdefine£¨¶¨Ò壩¡£ÒòΪCÎļþÒª±àÒë³É¿âÎļþ£¨WindowsÏÂÊÇ.obj/.lib£¬UNIXÏÂÊÇ.o/.a£©£¬Èç¹û±ðÈËҪʹÓÃÄãµÄº¯Êý£¬ÄÇô¾ÍÒªÒýÓÃÄãµÄHÎļþ£¬ËùÒÔ£¬HÎļþÖÐÒ»°ãÊDZäÁ¿¡¢ºê¶¨Ò塢ö¾Ù¡¢½á¹¹ºÍº¯Êý½Ó¿ÚµÄÉùÃ÷£¬¾ÍÏñÒ»¸ö½Ó¿Ú˵Ã÷ÎļþÒ»Ñù¡£¶øCÎļþÔòÊÇʵÏÖϸ½Ú¡£
HÎļþºÍCÎļþ×î´óµÄÓô¦¾ÍÊÇÉùÃ÷ºÍʵÏÖ·Ö¿ª¡£Õâ¸öÌØÐÔÓ¦¸ÃÊǹ«ÈϵÄÁË£¬µ«ÎÒÈÔÈ»¿´µ½ÓÐЩÈËϲ»¶°Ñº¯ÊýдÔÚHÎļþÖУ¬ÕâÖÖÏ°¹ßºÜ²»ºÃ¡££¨Èç¹ûÊÇC++»°£¬¶ÔÓÚÆäÄ£°åº¯Êý£¬ÔÚVCÖÐÖ»ÓаÑʵÏÖºÍÉùÃ÷¶¼Ð´ÔÚÒ»¸öÎļþÖУ¬ÒòΪVC²»Ö§³Öexport¹Ø¼ü×Ö£©¡£¶øÇÒ£¬Èç¹ûÔÚHÎļþÖÐдÉϺ¯ÊýµÄʵÏÖ£¬Ä㻹µÃÔÚmakefileÖаÑÍ·ÎļþµÄÒÀÀµ¹ØϵҲ¼ÓÉÏÈ¥£¬Õâ¸ö¾Í»áÈÃÄãµÄmakefileºÜ²»¹æ·¶¡£
×îºó£¬ÓÐÒ»¸ö×îÐèҪעÒâµÄµØ·½¾ÍÊÇ£º´ø³õʼ»¯µÄÈ«¾Ö±äÁ¿²»Òª·ÅÔÚHÎļþÖУ¡ ......
C³ÌÐòÓë»ã±à³ÌÐòÏ໥µ÷ÓùæÔò
ΪÁËʹµ¥¶À±àÒëµÄCÓïÑÔ³ÌÐòºÍ»ã±à³ÌÐòÖ®¼äÄܹ»Ï໥µ÷Ó㬱ØÐëΪ×Ó³ÌÐò¼äµÄµ÷Óùæ
¶¨Ò»¶¨µÄ¹æÔò¡£ATPCS£¬¼´ARM£¬ Thumb¹ý³Ìµ÷Óñê×¼(ARM/Thumb Procedure Call
Standard)£¬ÊÇARM³ÌÐòºÍThumb³ÌÐòÖÐ×Ó³ÌÐòµ÷ÓõĻù±¾¹æÔò£¬Ëü¹æ¶¨ÁËһЩ×Ó³ÌÐò¼äµ÷ÓÃ
µÄ»ù±¾¹æÔò£¬Èç×Ó³ÌÐòµ÷Óùý³ÌÖеļĴæÆ÷µÄʹÓùæÔò£¬¶ÑÕ»µÄʹÓùæÔò£¬²ÎÊýµÄ´«µÝ¹æÔò
µÈ¡£
ÏÂÃæ½áºÏʵ¼Ê½éÉܼ¸ÖÖATPCS¹æÔò£¬Èç¹û¶ÁÕßÏëÁ˽â¸ü¶àµÄ¹æÔò£¬¿ÉÒԲ鿴Ïà¹ØµÄÊé
¼®¡£
1£® »ù±¾ATPCS
»ù±¾ATPCS¹æ¶¨ÁËÔÚ×Ó³ÌÐòµ÷ÓÃʱµÄһЩ»ù±¾¹æÔò£¬°üÀ¨ÏÂÃæ3·½ÃæµÄÄÚÈÝ£º
(1)¸÷¼Ä´æÆ÷µÄʹÓùæÔò¼°ÆäÏàÓ¦µÄÃû³Æ¡£
(2)Êý¾ÝÕ»µÄʹÓùæÔò¡£
(3)²ÎÊý´«µÝµÄ¹æÔò¡£
Ïà¶ÔÓÚÆäËüÀàÐ͵ÄATPCS£¬Âú×ã»ù±¾ATPCSµÄ³ÌÐòµÄÖ´ÐÐËٶȸü¿ì£¬ËùÕ¼ÓõÄÄÚ´æ¸üÉÙ¡£
µ«ÊÇËü²»ÄÜÌṩÒÔϵÄÖ§³Ö£º ARM³ÌÐòºÍThumb³ÌÐòÏ໥µ÷Ó㬠Êý¾ÝÒÔ¼°´úÂëµÄλÖÃÎÞ¹Ø
µÄÖ§³Ö£¬×Ó³ÌÐòµÄ¿ÉÖØÈëÐÔ£¬Êý¾ÝÕ»¼ì²éµÄÖ§³Ö¡£
¶øÅÉÉúµÄÆäËû¼¸ÖÖÌض¨µÄATPCS¾ÍÊÇÔÚ»ù±¾ATPCSµÄ»ù´¡ÉÏÔÙÌí¼ÓÆäËûµÄ¹æÔò¶øÐγÉ
µÄ¡£ÆäÄ¿µÄ¾ÍÊÇÌṩÉÏÊöµÄ¹¦ÄÜ¡£
2£® ¼Ä´æÆ÷µÄʹÓùæÔò
¼Ä´æÆ÷µÄʹÓñØÐëÂú×ãÏÂÃæµÄ¹æÔò£º
(1) × ......
½ñÌìÓÃÁË°ëÌìʱ¼ä£¬ÓÃNotepad++×é×°ÁËÒ»¸ö×ÔÈÏΪ×îÇ¿µÄPHP¼¯³É¿ª·¢»·¾³.
Ö÷Òª¹¦ÄÜÈçÏ£º
ÏîÄ¿¹ÜÀí
Ç¿´óµ÷ÊÔÄÜÁ¦
Ç¿´óµÄ²éÕÒÌæ»»¹¦ÄÜ
¼«Ð¡µÄºÄ·Ñϵͳ×ÊÔ´(×î¶àºÄ·Ñ2MÄÚ´æ)
¼«¿ìµÄÔËÐÐËٶȣ¬¿ÉÒÔÓë¼Çʱ¾ÏàæÇÃÀ
Óï·¨¸ßÁÁ,ÕÛµþ
´úÂë×Ô¶¯Íê³É(º¯Êý£¬±äÁ¿)
Îļþ±È½Ï
´úÂëµ¼³ö
ºê¼ÖÆ,»Ø·Å
Ö§³ÖÆäËûÓïÑÔ(java,c,c++,xmlµÈ)
·½±ãµÄ¸ñʽºÍ±àÂëת»»
SVN°æ±¾¿Í»§¶Ë
ÓëÆäËû¿ª·¢»·¾³¶Ô±ÈÈçÏ£º
Óŵ㣺
Ëٶȿ죬ºÄ·Ñ×ÊԴС,Óï·¨¸ßÁÁÀàÐͶà,²éÕÒÌæ»»·½±ã,²å¼þÖ§³Ö
ȱµã£º
º¯ÊýÁбíδÄÜʵÏÖ,ûÓÐDWµÄweb¿ÉÊÓ»¯±à¼Æ÷
......
getenv£¨È¡µÃ»·¾³±äÁ¿ÄÚÈÝ£©
Ïà¹Øº¯Êý putenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include<stdlib.h>
¶¨Ò庯Êý char * getenv(const char *name);
º¯Êý˵Ã÷ getenv()ÓÃÀ´È¡µÃ²ÎÊýname»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýnameΪ»·¾³±äÁ¿µÄÃû³Æ£¬Èç¹û¸Ã±äÁ¿´æÔÚÔò»á·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õë¡£»·¾³±äÁ¿µÄ¸ñʽΪname£½value¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õ룬ÕÒ²»µ½·ûºÏµÄ»·¾³±äÁ¿Ãû³ÆÔò·µ»ØNULL¡£
·¶Àý #include<stdlib.h>
mian()
{
char *p;
if((p = getenv(“USER”)))
printf(“USER=%s\n”,p);
}
Ö´ÐÐ USER = root
¡¡
putenv£¨¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿£©
Ïà¹Øº¯Êý getenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include4<stdlib.h>
¶¨Ò庯Êý int putenv(const char * string);
º¯Êý˵Ã÷ putenv()ÓÃÀ´¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýstringµÄ¸ñʽΪname£½value£¬Èç¹û¸Ã»·¾³±äÁ¿ÔÏÈ´æÔÚ£¬Ôò±äÁ¿ÄÚÈÝ»áÒÀ²ÎÊýstring¸Ä±ä£¬·ñÔò´Ë²ÎÊýÄÚÈÝ»á³ÉΪеĻ·¾³±äÁ¿¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»Ø0£¬ÓдíÎó·¢ÉúÔò·µ»Ø-1¡£
´íÎó´úÂë ENOMEM ÄÚ´æ²»×㣬ÎÞ·¨ÅäÖÃеĻ·¾³±äÁ¿¿Õ¼ä¡£
·¶Àý #include<stdlib.h>
main()
{
char *p;
if((p = getenv(&ld ......
getenv£¨È¡µÃ»·¾³±äÁ¿ÄÚÈÝ£©
Ïà¹Øº¯Êý putenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include<stdlib.h>
¶¨Ò庯Êý char * getenv(const char *name);
º¯Êý˵Ã÷ getenv()ÓÃÀ´È¡µÃ²ÎÊýname»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýnameΪ»·¾³±äÁ¿µÄÃû³Æ£¬Èç¹û¸Ã±äÁ¿´æÔÚÔò»á·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õë¡£»·¾³±äÁ¿µÄ¸ñʽΪname£½value¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õ룬ÕÒ²»µ½·ûºÏµÄ»·¾³±äÁ¿Ãû³ÆÔò·µ»ØNULL¡£
·¶Àý #include<stdlib.h>
mian()
{
char *p;
if((p = getenv(“USER”)))
printf(“USER=%s\n”,p);
}
Ö´ÐÐ USER = root
¡¡
putenv£¨¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿£©
Ïà¹Øº¯Êý getenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include4<stdlib.h>
¶¨Ò庯Êý int putenv(const char * string);
º¯Êý˵Ã÷ putenv()ÓÃÀ´¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýstringµÄ¸ñʽΪname£½value£¬Èç¹û¸Ã»·¾³±äÁ¿ÔÏÈ´æÔÚ£¬Ôò±äÁ¿ÄÚÈÝ»áÒÀ²ÎÊýstring¸Ä±ä£¬·ñÔò´Ë²ÎÊýÄÚÈÝ»á³ÉΪеĻ·¾³±äÁ¿¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»Ø0£¬ÓдíÎó·¢ÉúÔò·µ»Ø-1¡£
´íÎó´úÂë ENOMEM ÄÚ´æ²»×㣬ÎÞ·¨ÅäÖÃеĻ·¾³±äÁ¿¿Õ¼ä¡£
·¶Àý #include<stdlib.h>
main()
{
char *p;
if((p = getenv(&ld ......
C++ÖеÄÊý¾ÝÀàÐÍת»»·½·¨
ÕªÒª£º±¾ÎÄ×ܽáÁËC/C++ÖеĶàÖÖÊý¾ÝÀàÐÍת»»·½·¨£¬²¢±È½ÏÁ˸÷×ÔµÄÓÅÁÓ¡£¸ø³öÁËÍƼöµÄʹÓý¨Òé¡£
´Óintµ½char*£¬»òÕß·´¹ýÀ´´Óchar*µ½int£¬ÔÚC/C++Öе½µ×ÓжàÉÙÖÖת»»·½·¨ÄØ£¿·ûºÏ±ê×¼µÄ´ó¸ÅÓÐËÄÖÖ¡£¼´CÊý¾Ýת»»º¯Êý×å¡¢sprintf/snprintf/sscanfº¯Êý×å¡¢×Ö·û´®Á÷std::stringstream¡¢std::strsteam¡£²»·ûºÏ±ê׼ȴÓÖ¹ãΪʹÓõİüÀ¨CStringºÍboost::lexical_cast¡£±¾ÎÄÖ»ÌÖÂÛ·ûºÏ±ê×¼µÄת»»·½·¨£¬ÆäÖÐstd::strstreamÓÉÓÚÒѾ±»C++±ê׼ίԱΪָ¶¨Îª²»ÍƼöʹÓõģ¨deprecated£©£¬ËùÒÔ²»Ó迼ÂÇÁË¡£ÏÂÃæÖصãÌÖÂÛÈýÖÖ±ê׼ת»»·½·¨Ö®¼äµÄÓÅÁÓ¡£Ô´´úÂëµÄµØÖ·ÊÇ£ºhttp://download.csdn.net/source/631475
1. IntºÍchar*»òstd::stringÖ®¼äµÄת»»
CÊý¾Ýת»»º¯Êý×å
CÊý¾Ýת»»º¯Êý×å¼´°üÀ¨itoa¡¢atoiµÈÊý¾ÝÀàÐÍת»»º¯ÊýÔÚÄÚµÄÒ»´óÅúCº¯Êý£¬ÔÚCÓïÑÔʱ´úÔø¾±»´óÁ¿Ê¹Óá£Ô´´úÂëÈçÏ£º
int i = 10;
char szBuf[10] = "";
itoa(i, szBuf, 10);
cout<<"itoa: szBuf = "<<szBuf<<endl;
i = 0;
i = atoi(szBuf);
cout<<"atoi: i = "<<i<<endl;
ʹÓû¹ÊDZȽϼòµ¥µÄ¡£Ò»¸ö×î´óµÄÎÊÌâÊÇ£ºÃ»ÓнøÐÐchar*µÄÔ½ ......