Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Myprog.ini how to create
Message
 
À
26/08/2004 23:33:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00936878
Message ID:
00936895
Vues:
19
Try this:
*** To create & wrtite to ini file
WriteToIni("Main","DSN","DSNValue",full_path_to_ini+"MyIni.ini")
WriteToIni("Main","Pass","PassValue",full_path_to_ini+"MyIni.ini")

*** To read from ini file
cDsn  = ReadIni("Main", "DSN", full_path_to_ini+"MyIni.Ini")
cPass = ReadIni("Main", "Pass", full_path_to_ini+"MyIni.Ini")


FUNCTION ReadIni(cSection, cEntry, cIniFile)

   LOCAL ret_val
   DECLARE INTEGER GetPrivateProfileString IN Win32API  AS GetPrivStr ;
                                                           String cSection,;
                                                           String cKey,;
                                                           String cDefault,;
                                                           String @cBuffer, ;
                                                           Integer nBufferSize,;
                                                           String cINIFile
   ret_val = SPACE(1024)
   GetPrivStr(cSection, cEntry,"",@ret_val,1024,cIniFile)

RETURN STRTRAN(ALLTRIM(ret_val), CHR(0), "")


FUNCTION WriteIni(cSection, cEntry, cString, cIniFile)

   DECLARE INTEGER WritePrivateProfileString IN Win32API AS WritePrivStr ;
                                                            String cSection,;
                                                            String cKey,;
                                                            String cValue,;
                                                            String cINIFile
   WritePrivStr(cSection,cEntry,cString,cIniFile)

RETURN ""
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform