= \@bcat |
= \@icat{Programming} |
= \@scat |
= \@cat{wikiX} |
= \@ecat |
= \TableOfContents |
= !c·Î § ÇÁ·Î±×·¥¿¡ ¿òÁ÷ÀÌ´Â /¸¦ ³Ö°í½Í½À´Ï´Ù. |
= |
= [bbs.kldp.org | http://bbs.kldp.org/]¿¡¼ [ageldama´ÔÀÇ ±Û| http://bbs.kldp.org/viewtopic.php?t=2456 ]À» ÀοëÇÕ´Ï´Ù. |
= |
= printfÀÇ \\bÀ̳ª \\rÀ» ÀÌ¿ëÇÏ¿© °°Àº ÁÙÀ̳ª ÀÌÀü ¹®ÀÚ¸¦ |
= ´Ù½Ã µ¤¾î¾º¿ì¸é °£´ÜÈ÷ ±¸ÇöÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù. |
= |
= ÄÚµå: |
= /*! wikiXmacros¿Í \\basis \\easis ÀÌ¿ë*/ |
= \def@bverb={ |
= <tt> |
= \dcSave |
= \noDefault |
= } |
= \def@everb={ |
= \dcRestore |
= </tt> |
= } |
= \def@bverbox=<table style="background-color:#eeeeee; border:1 solid;"><tr><td>\@bverb |
= \def@everbox=\@everb</td></tr></table> |
= \@bverbox |
= \basis |
= printf("foo...\\"); |
= for ( int i = 0 ; i < 9999 ; i ++ ) |
= { |
= if ( i % 2 ) |
= printf("\b\\"); |
= else |
= printf("\b/"); |
= } |
= \easis |
= \@everbox |
= |
= |
= |
= \\b´Â backspace ÀÌÀü ¹®ÀÚÀÇ À§Ä¡·Î ÇöÀçÃâ·Â À§Ä¡¸¦ µÇµ¹¸³´Ï´ç |
= |
= \\rÀº ¹¹ Çѹ®ÀÚ ÀÌ¿Ü¿¡ ÇÑÁÙ ¶Ù¾î³Ñ±â°¡ ¾Æ´Ï¶ó ÁÙÀÇ ¾ÕÀ¸·Î Ä¿¼¸¦ |
= µÇµ¹¸®¹Ç·Î »õ·Î ½ºÅ©·ÑÀ» ÇÏÁö ¾Ê°í ÇöÀçÇü¿¡ ´Ù½Ã Ãâ·ÂÀ» ÇÒ ¼ö ÀÖ°Ô ÇÕ´Ï´Ù. |
= (µÑ ´Ù µ¤¾î¾º¿ì¸é µÇ´Â°ÅÁö¿ä ^^ |
= |
= »ö»óµîÀº curses³ª ¾È½ÃÄڵ带 Âü°íÇϼ¼¿ä. |
= (À©µµ¶ó¸é TCÀÇ conio.h°°Àº ±â´ÉÀ» wconio·Î ±¸ÇöÇÑ ÇÁ·ÎÁ§Æ®µµ ÀÖ´ø°Å °°Àºµ¥... ¾Æ´Ï¸é Á÷Á¢ ´ÙÀ½°ú °°ÀÌ Äڵ带 ÀÛ¼ºÇϼŵµ µË´Ï´Ù.) |
= |
= ÄÚµå: |
= |
= \#include <windows.h> |
= ... |
= |
= //Ãâ·ÂÇÚµé. ±âº»ÀûÀ¸·Î Äܼ־îÇÃÀÌ´Ï±î »õ Äִܼë½Å. |
= HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); |
= ... |
= |
= //»ö»ó ¹× ¼Ó¼ºº¯°æ |
= //fg:Èò»ö-º¼µå bg:ÆĶû |
= SetConsoleTextAttribute(hStdOut,FOREGROUND_WHITE|BACKGROUND_BLUE|FOREGROUND_INTENSITY); |
= |
= |
= |
= |
= °£´ÜÈ÷ ÇÔ¼ö·Î °¨½Î¼ ¾à°£ À©µµ¿¡¸¸ ±¹ÇѵÇÁö ¾Ê°Ô ÇÏ½Ã¸é µÉ°Å °°³×¿ä. |
= MSDNµîÀ» Âü°íÇϼ¼¿ä. (±Ùµ¥ Àú·± »ö»ó°ªµµ ÀÖ´ø°¡-_-) |
= |
= !\[PHP]ÁøÂ¥ °£´Ü-ÇãÁ¢- ¾Ù¹ü ¸¸µé±â |
= °ú¿¬ ÀÌ°Ô ÇÊ¿äÇÏ½Ç ºÐÀÌ ÀÖÀ»·±Áö Àǹ®ÀÔ´Ï´Ù¸¸ |
= |
= php¸¦ »ç¿ëÇÑ ¾Ù¹ü ¸¸µé±âÀÔ´Ï´Ù. |
= |
= µðÄ«·Î »çÁøÀ» Âï¾îµµ °Ô½ÃÆÇ¿¡ Çϳª¾¿ ¾÷·ÎµåÇÏ´Â °Ô ³Ê¹« ±ÍÂú¾Æ¼¿ä. -_- ±×³É °èÁ¤¿¡ ftp·Î ¿Ã·Á¹ö¸®°í DBµµ ¾È¾²°í ÇãÁ¢ÇÑ ¾Ù¹üÀ» ¸¸µé¾îºÃ½À´Ï´Ù. |
= |
= ±×³É ¾´ ¹æ¹ýÀº PHP 4.3.0 ºÎÅÍ Áö¿øµÇ´Â globÀ̶ó´Â ÇÔ¼ö¸¦ ÀÌ¿ëÇÑ °Ì´Ï´Ù. |
= ÀÌ ÇÔ¼ö´Â ÇöÀç µð·ºÅ丮¿¡¼ ÆÄÀϸíµéÀ» »Ì¾Æ³»´Â ÇÔ¼öÀä.. |
= ÀÌ ÇÔ¼ö·Î jpg³ª bmp ÆÄÀÏÀ» ã¾Æ¼ ¼ø¼´ë·Î, ÆäÀÌÁöº°·Î IMGű׿¡ ¹°·ÁÁÖ´Â °Ì´Ï´Ù. µðÀÚÀÎ °°Àº °Í.. ¾ø½À´Ï´Ù. Å×À̺í? ¾È»ç¿ëÇÕ´Ï´Ù. ±×³É À̹ÌÁö ÅÂ±× ½áÁÖ°í <BR>·Î ÁٹٲãÁÖ°í ³¡ÀÔ´Ï´Ù. ÆÄÀϸíÀÌ ³ª¿À´Â ¼ø¼´Â ¾ËÆĺª ¼ø¼ °°Àºµ¥.. À½..°Å±â±îÁö´Â ½Å°æ ¾È½è½À´Ï´Ù. |
= |
= index.php |
= |
= \@bverbox |
= \basis |
= <html> |
= <head> |
= <title> Album </title> |
= </head> |
= <body> |
= |
= <?php |
= /***********************Album***********************/ |
= /********it's crude.. -_- |
= Daniel J. Song |
= 2003.7.26 |
= There's no license of this. |
= *********/ |
= @extract($HTTP_GET_VARS); // page¿Í files_per_page º¯¼ö °¡Á®¿É´Ï´Ù. |
= if (!$page || $page<1) |
= $page=1; |
= if (!$files_per_page || $files_per_page<1) |
= $files_per_page=5; //ÆäÀÌÁö´ç 5°³ ±×¸². |
= $i=0; |
= foreach (glob("*[jJ][Pp][Gg]") as $filename) { //JPG ÆÄÀÏÀ» »Ì¾Æ³À´Ï´Ù. |
= if ($i >= ($page-1)*$files_per_page && $i < $page*$files_per_page) |
= [rommance@localhost cheju]$ cat index.php |
= <html> |
= <head> |
= <title> Album </title> |
= </head> |
= <body> |
= |
= <?php |
= @extract($HTTP_GET_VARS); // page¿Í files_per_page º¯¼ö °¡Á®¿É´Ï´Ù. |
= if (!$page || $page<1) |
= $page=1; |
= if (!$files_per_page || $files_per_page<1) |
= $files_per_page=5; //ÆäÀÌÁö´ç 5°³ ±×¸². |
= $i=0; |
= foreach (glob("*[jJ][Pp][Gg]") as $filename) { //JPG ÆÄÀÏÀ» »Ì¾Æ³À´Ï´Ù. |
= if ($i >= ($page-1)*$files_per_page && $i < $page*$files_per_page) |
= echo "<IMG src=$filename> <br>"; //ÇöÀç ÆäÀÌÁö ¹øÈ£¿¡ ¸Â´Â ÆÄÀÏ ÇÁ¸°Æ® |
= $i++; // $i·Î ¼¼´Â °ÅÁÒ. |
= |
= } |
= foreach (glob("*[Bb][Mm][Pp]") as $filename) { //À̹ø¿£ BMPÆÄÀÏÀ» ã½À´Ï´Ù. |
= if ($i >= ($page-1)*$files_per_page && $i < $page*$files_per_page) |
= echo "<IMG src=$filename> <br>"; |
= $i++; |
= } |
= /**************±×¸² ³¡****************/ |
= /*********** ÀÌÀü, ´ÙÀ½ ¹öÆ° *********/ |
= if ($page>1) |
= echo "<a href='index.php?page=". ($page-1) ."&files_per_page=5'>ÀÌÀü</a> "; |
= if ($i<=$page*$files_per_page) // $i= # of all pictures |
= ;//echo "end of pictures<br>\n"; // end of files |
= else |
= echo " <a href='index.php?page=". ($page+1) ."&files_per_page=5'>´ÙÀ½</a>"; |
= |
= echo "<br>"; |
= /************* ¾ÕµÚ 5¼¸°³ ÆäÀÌÁö¾¿ ¸µÅ© ********/ |
= if ($page<6) |
= $j=1; |
= else |
= $j=$page-5; |
= for (; $j<$page; $j++) |
= echo "<a href='index.php?page=". $j ."&files_per_page=5'>[". $j ."]</a> "; |
= echo "[".$page."]"; |
= |
= $max_page= ($i)/$files_per_page; |
= for ($j=$page+1; $j<$max_page+1 && $j<$page+6; $j++) { |
= echo "<a href='index.php?page=". $j ."&files_per_page=5'>[". $j ."]</a> "; |
= } |
= |
= ?> |
= </body> |
= </html> |
= \easis |
= \@everbox |
= »ç¿ë¹ýÀº ±×¸² ÆÄÀÏ(jpg³ªbmp)À» ÀÓÀÇÀÇ µð·ºÅ丮¿¡ ¾÷·Îµå ÇϽŠ´ÙÀ½¿¡ ÀÌ index.php ÆÄÀÏÀ» °°Àº µð·ºÅ丮¿¡ ¾÷·ÎµåÇØÁÖ½Ã¸é µË´Ï´Ù. |
= |
= !crc |
= http://my.netian.com/~hwimh/pgm_crc.html |
+ |
+ !À©µµ¿ìÁî 2000,XP ÆÄ¿ö ²ô±â, ¸®ºÎÆÃÇϱâ |
+ 2001³âµµ¿¡ ®´ø °Í °°³×¿ä. À©µµ¿ìÁî2000 °è¿ÀÇ ÆÄ¿ö ²ô´Â ¼Ò½ºÄÚµåÀÔ´Ï´Ù. VC6.0À¸·Î ®°í, ÇÁ·Î±×·¥À» ÇÏ½Ç ÁÙ ¾Æ½Ã¸é ¹¹ÇÏ´Â °ÍÀÎ Áö ±Ý¹æ ¾Æ½Ç µí. |
+ |
+ \PwrTest.h |
+ \@bverbox |
+ \basis |
+ |
+ #if !defined(AFX_PWRTEST_H__149C02D0_B545_4699_A4A5_DFDB719EFBFB__INCLUDED_) |
+ #define AFX_PWRTEST_H__149C02D0_B545_4699_A4A5_DFDB719EFBFB__INCLUDED_ |
+ |
+ #if _MSC_VER > 1000 |
+ #pragma once |
+ #endif // _MSC_VER > 1000 |
+ |
+ #include "resource.h" |
+ |
+ /////////////// Jiseok |
+ int PowerOff(); |
+ int Reboot(); |
+ int GetWinVersion(OSVERSIONINFO* windowsversion); |
+ int DoPowerOff(OSVERSIONINFO* windowsversion); |
+ int DoReboot(OSVERSIONINFO* windowsversion); |
+ int AquirePrivileges(OSVERSIONINFO* windowsversion); |
+ ////////////// end Jiseok |
+ |
+ #endif // !defined(AFX_PWRTEST_H__149C02D0_B545_4699_A4A5_DFDB719EFBFB__INCLUDED_) |
+ \easis |
+ \@everbox |
+ |
+ \PwrTest.cpp |
+ \@bverbox |
+ \basis |
+ // PwrTest.cpp : Defines the entry point for the console application. |
+ // |
+ |
+ #include "stdafx.h" |
+ #include "PwrTest.h" |
+ |
+ #ifdef _DEBUG |
+ #define new DEBUG_NEW |
+ #undef THIS_FILE |
+ static char THIS_FILE[] = __FILE__; |
+ #endif |
+ |
+ ///////////////////////////////////////////////////////////////////////////// |
+ // The one and only application object |
+ |
+ CWinApp theApp; |
+ |
+ using namespace std; |
+ |
+ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) |
+ { |
+ int nRetCode = 0; |
+ |
+ // initialize MFC and print and error on failure |
+ if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) |
+ { |
+ // TODO: change error code to suit your needs |
+ cerr << _T("Fatal Error: MFC initialization failed") << endl; |
+ nRetCode = 1; |
+ } |
+ else |
+ { |
+ // TODO: code your application's behavior here. |
+ |
+ //////////////// Jiseok |
+ //if (PowerOff()!=0) |
+ if (Reboot()!=0) |
+ return 1; |
+ //////////////// end Jiseok |
+ |
+ CString strHello; |
+ strHello.LoadString(IDS_HELLO); |
+ cout << (LPCTSTR)strHello << endl; |
+ } |
+ |
+ return nRetCode; |
+ } |
+ |
+ |
+ |
+ ///////////////// Jiseok |
+ |
+ int PowerOff() |
+ { |
+ OSVERSIONINFO Version; |
+ |
+ if (GetWinVersion(&Version)!=0) |
+ return -1; |
+ if (DoPowerOff(&Version)!=0) |
+ return -1; |
+ return 0; |
+ } |
+ |
+ int Reboot() |
+ { |
+ OSVERSIONINFO Version; |
+ |
+ if (GetWinVersion(&Version)!=0) |
+ return -1; |
+ if (DoReboot(&Version)!=0) |
+ return -1; |
+ return 0; |
+ } |
+ |
+ int GetWinVersion(OSVERSIONINFO* windowsversion) |
+ { |
+ windowsversion->dwOSVersionInfoSize=sizeof(OSVERSIONINFO); |
+ if (!GetVersionEx(windowsversion)) |
+ { |
+ printf("Error! getting version info"); |
+ return -1; |
+ } |
+ return 0; |
+ } |
+ |
+ int DoPowerOff(OSVERSIONINFO* windowsversion) |
+ { |
+ UINT mode; |
+ |
+ if (windowsversion->dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) |
+ mode=EWX_SHUTDOWN; |
+ else |
+ mode=EWX_POWEROFF; |
+ |
+ if (windowsversion->dwPlatformId==VER_PLATFORM_WIN32_NT) |
+ { |
+ // privilege ¾ò±â |
+ if (AquirePrivileges(windowsversion)!=0) |
+ { |
+ return -1; |
+ }//if |
+ }// if |
+ |
+ if (!ExitWindowsEx(mode,0)) // ²ô±â |
+ { |
+ printf("error ExitWindowsEx"); |
+ return -1; |
+ } |
+ return 0; |
+ } |
+ |
+ |
+ int DoReboot(OSVERSIONINFO* windowsversion) |
+ { |
+ UINT mode; |
+ |
+ mode=EWX_REBOOT; |
+ |
+ if (windowsversion->dwPlatformId==VER_PLATFORM_WIN32_NT) |
+ { |
+ // privilege ¾ò±â |
+ if (AquirePrivileges(windowsversion)!=0) |
+ { |
+ return -1; |
+ }//if |
+ }// if |
+ |
+ if (!ExitWindowsEx(mode,0)) // ²ô±â |
+ { |
+ printf("error ExitWindowsEx"); |
+ return -1; |
+ } |
+ return 0; |
+ } |
+ |
+ int AquirePrivileges(OSVERSIONINFO* windowsversion) |
+ { |
+ HANDLE current_thread,token; |
+ TOKEN_PRIVILEGES privs; |
+ LUID luid; |
+ |
+ current_thread=GetCurrentProcess(); |
+ if (!OpenProcessToken(current_thread,TOKEN_ADJUST_PRIVILEGES,&token)) |
+ { |
+ printf("Error! opening process token"); |
+ return -1; |
+ } |
+ if (!LookupPrivilegeValue(NULL,SE_SHUTDOWN_NAME,&luid)) |
+ { |
+ printf("Error! looking up privilege"); |
+ return -1; |
+ } |
+ privs.PrivilegeCount=1; |
+ privs.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED; |
+ privs.Privileges[0].Luid=luid; |
+ if (!AdjustTokenPrivileges(token,FALSE,&privs,0,NULL,NULL)) |
+ { |
+ printf("Error! getting privileges"); |
+ return -1; |
+ } |
+ return 0; |
+ } |
+ |
+ //////////// end Jiseok |
+ |
+ \easis |
+ \@everbox |