| |
|
|
|
Description:
WritePrivateProfileString writes a String under the angegebenen Rubrik and the angegebenen Eintragsnamen in a INI File. These API can also whole Rubriken and Deleting Entries and the cache the INI on The Festplatte write.
Deklaration:
Def @WritePrivateProfileString(4) !KERNEL32,WritePrivateProfileStringA
Parameter:
1.Parameter: address one Strings or Memory-Variable with a String, the The Rubrik for entry contains. is this worth, Parameter 2 and Parameter 3 zero, becomes the cache the INI on The disk written. 2.Parameter: address one Strings or Memory-Variable with a String, the whom Eintragsnamen contains. is this worth 0, becomes The angegebene Rubrik deleted (unless, Parameter 1 is zero). 3.Parameter: address one Strings or Memory-Variable with a String, the whom hinzuzufügenden entry contains. is this worth 0, becomes the entry deleted (unless, Parameter 1 and 2 is zero). 4.Parameter: address one Strings or Memory-Variable with a String, the names and way the INI contains. existing The File not, becomes tappt im dunkeln created.
Return Value:
1 If the String successful registered watts, 0 with failure or if the cache on The Festplatte written watts.
Examples:
CompileMarkSeparationDef @WritePrivateProfileString(4) !"KERNEL32","WritePrivateProfileStringA"
Declare Section$,Key$,Wert$,File$,FileLöschen&,SectionDel&,KeyLesen&,KeyDel&,Flush&
Windowstyle 31+512
Windowtitle "Die API WritePrivateProfileString"
Window 0,0-640,440
Let Section$="Eigene Daten"
Let Key$="Mein Eintrag"
Let Wert$="Mein Wert"
LET FILE$="C:TEST.INI"
Let FileLöschen&=@CreateButton(%HWND,"INI Löschen",20,200,150,30)
Let KeyLesen&=@CreateButton(%HWND,"Key "+Key$+" lesen",200,200,200,30)
Let Flush&=@CreateButton(%HWND,"INI flushen",450,200,150,30)
Let SectionDel&=@CreateButton(%HWND,"Sektion "+Section$+" Löschen",20,250,230,30)
Let KeyDel&=@CreateButton(%HWND,"Key "+Key$+" Löschen",280,250,230,30)
@WritePrivateProfileString(@Addr(Section$),@Addr(Key$),@Addr(Wert$),@Addr(File$))
While %MENUITEM<>-2
Waitinput
IF @Getfocus(KeyLesen&)
Set("Errorlevel",-1)
Print @READINI$(File$,Section$,Key$)
Set("Errorlevel",0)
ElseIF @Getfocus(SectionDel&)
@WritePrivateProfileString(@Addr(Section$),0,0,@Addr(File$))
Beep 1
ElseIF @Getfocus(KeyDel&)
@WritePrivateProfileString(@Addr(Section$),@Addr(Key$),0,@Addr(File$))
Beep 1
ElseIF @Getfocus(FileLöschen&)
Assign #1,File$
Erase #1
Beep 1
ElseIF @Getfocus(Flush&)
@WritePrivateProfileString(0,0,0,@Addr(File$))
Beep 1
endif
function-references/XProfan/wend/'>Wend
|
|
|
| |
|
|