BOOL WriteProfileString ( LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCTSTR lpszValue );
¹Ýȯ °ª
¼º°ø ÇÏ´Â °æ¿ì 0ÀÌ ¾Æ´Ñ ±×·¸Áö ¾ÊÀ¸¸é 0¡£
¸Å°³ º¯¼ö
lpszSection
Ç׸ñÀ» Æ÷ÇÔ ÇÏ´Â ¼½¼ÇÀ» ÁöÁ¤ ÇÏ´Â null·Î ³¡³ª´Â ¹®ÀÚ¿À» °¡¸®Åµ´Ï´Ù. ¼½¼Ç¿¡¼ Á¸Àç ÇÏÁö ¾Ê´Â °æ¿ì »ý¼º µË´Ï´Ù. ¼½¼Ç À̸§Àº °æ¿ì µ¶¸³; ¸ðµç Á¶ÇÕÀ» ´ë¹®ÀÚ ¹× ¼Ò¹®ÀÚ ¹®ÀÚ¿ ¼ö ÀÖ½À´Ï´Ù.
lpszEntry
°ª ±â·Ï Ç׸ñÀ» Æ÷ÇÔ ÇÏ´Â null·Î ³¡³ª´Â ¹®ÀÚ¿À» °¡¸®Åµ´Ï´Ù. ¸¸µç Ç׸ñ ÁöÁ¤µÈ ¼½¼Ç¿¡¼ Á¸Àç ÇÏÁö ¾Ê´Â °æ¿ì¡£
lpszValue
¾µ ¹®ÀÚ¿À» °¡¸®Åµ´Ï´Ù. ÀÌ ¸Å°³ º¯¼ö°¡ NULLÀ̸é lpszEntry ¸Å°³ º¯¼ö¿¡ ÀÇÇØ ÁöÁ¤ µÈ Ç׸ñ »èÁ¦¡£
ÁÖÀÇ
ÁöÁ¤ µÈ ÀÀ¿ë ÇÁ·Î±×·¥ÀÇ ·¹Áö½ºÆ®¸® ¼½¼Ç¿¡ ÁöÁ¤µÈ µÈ ¹®ÀÚ¿À» ÀÛ¼º ÇÏ·Á¸éÀÌ ¸â¹ö ÇÔ¼ö¸¦ È£Ãâ Çϰųª.INI ÆÄÀÏ¡£
Ç׸ñÀÌ ´ÙÀ½°ú °°ÀÌ ÀúÀå µË´Ï´Ù.:
¿¹Á¦
nbsp;??CString strSection = "My ¼½¼Ç";
? CString strStringItem = "My String Ç׸ñ";
? CString strIntItem = "My Int Ç׸ñ";
CWinApp * pApp = AfxGetApp();
pApp-> WriteProfileString (strSection, strStringItem, "test");
CString strValue;
? strValue = pApp-> GetProfileString (strSection, strStringItem);
? ASSERT (strValue = "Å×½ºÆ®");
pApp-> WriteProfileInt (strSection, strIntItem, 1234);
? int nValue;
? nValue = pApp-> GetProfileInt (strSection, strIntItem, 0);
? ASSERT(nValue == 1234)
CWinApp °³¿ä |nbsp; Ŭ·¡½º ¸â¹ö (ko) | °èÃþ ±¸Á¶ Â÷Æ®(&N)
Âü°í Ç׸ñnbsp;CWinApp::GetProfileString, CWinApp::WriteProfileInt, :: WritePrivateProfileString, CWinApp::SetRegistryKey(&N)