ERS C++Builder (Android) INI Files 用法
Android app(四)儲存設定用的 ini 檔案或 LocalDB(SQLite、IBLite) 應該存放在哪裡?
http://jamesjuantw.pixnet.net/blog/post/162918281
Example:
http://docwiki.embarcadero.com/CodeExamples/Tokyo/en/IniFilesTMemIniFile_(C%2B%2B)
String sIniFileName = System::Ioutils::TPath::GetDocumentsPath() + PathDelim + "Test.ini";
TIniFile *pIniFile = new TIniFile( sIniFileName);
// ini 檔案如果已存在, 會直接 open file, 如果不存在則 Create File.
pIniFile->WriteString( sSection, "Caption", Caption);
sCaption = pIniFile->ReadString( sSection, "Caption", "123");
delete pIniFile; // 一定要 delete TIniFile 後資料才會真正 Save to File.
ERS C++Builder (Android) TPath 用法
Delphi android路径 TPath 文件路径,文件管理
http://ahmoremore.blogspot.com/2017/11/delphi-android-tpath.html
Disk And Directory Support Routines
http://docwiki.embarcadero.com/RADStudio/Berlin/en/Disk_And_Directory_Support_Routines
Standard RTL Path Functions across the Supported Target Platforms
http://docwiki.embarcadero.com/RADStudio/XE8/en/Standard_RTL_Path_Functions_across_the_Supported_Target_Platforms
#include <System.Ioutils.hpp>
String sPath = System::Ioutils::TPath::GetDocumentsPath();
String sIniFileName = System::Ioutils::TPath::GetDocumentsPath() + PathDelim + "Test.ini";
=> "/data/data/com.embarcadero.MyPrj/files/Test.ini"
沒有留言:
張貼留言