Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 2 of 2 total |
Access to Elevate Web Server ini file? |
Mon, May 14 2018 3:21 PM | Permanent Link |
Ralf Mimoun | Hi all,
I am writing a server module that needs a configuration file. Is there any way to access the ewbsrvr.ini, get the file name of the ini file used or get the folder? It would help to put all config data in one file or at least in the same folder. Ralf |
Fri, May 18 2018 1:36 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ralf,
<< I am writing a server module that needs a configuration file. Is there any way to access the ewbsrvr.ini, get the file name of the ini file used or get the folder? It would help to put all config data in one file or at least in the same folder. >> I would recommend using your own sub-folder and .ini file, and you can use this code to do so: uses Windows, ShlObj; function OSAppDataDirectory: String; var TempBuffer: array[0..MAX_PATH] of Char; ResultLength: Integer; begin FillChar(TempBuffer,((MAX_PATH+1)*SizeOf(Char)),0); ShlObj.SHGetSpecialFolderPathW(0,@TempBuffer,CSIDL_LOCAL_APPDATA,False); ResultLength:=WStrLen(pChar(@TempBuffer)); SetLength(Result,ResultLength); Move(TempBuffer[0],pChar(Result)^,(ResultLength*SizeOf(Char))); end; function GetAppDataDirectory: String; begin {$WARN SYMBOL_PLATFORM OFF} Result:=IncludeTrailingBackslash(OSAppDataDirectory)+'Your Company Name\Your Product Name'; if (not DirectoryExists(Result)) then ForceDirectories(Result); {$WARN SYMBOL_PLATFORM ON} end; function GetIniFileName: String; begin {$WARN SYMBOL_PLATFORM OFF} Result:=GetAppDataDirectory+PathDelim+'yourapplication.ini'); {$WARN SYMBOL_PLATFORM ON} end; Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, September 13, 2024 at 03:42 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |