Symbian下ini文件的操作
程序中的一些配置信息,可以利用ini文件存储。同时存储到安装程序的私有路径下面。
_LIT(KtxDicFileName ,"settings.ini" );
const TInt KRegistrar = 2;
const TInt KUsername = 3;
const TInt KPassword = 4;
一些数据通过流方式的读取
// String
TBuf<100> iText;
aStream >> iText;
// Integer
TInt iVolume;
iVolume = aStream.ReadInt32L();
// Boolean
TBool iBinary;
iBinary = aStream.ReadInt16L();
// Ip address
TInetAddr iIpAddress;
iIpAddress.SetAddress(aStream.ReadUint32L());
// Time
TTime iTime;
TInt64 time;
aStream >> time;
iTime = TTime(time);
TBuf<100> iText;
aStream >> iText;
// Integer
TInt iVolume;
iVolume = aStream.ReadInt32L();
// Boolean
TBool iBinary;
iBinary = aStream.ReadInt16L();
// Ip address
TInetAddr iIpAddress;
iIpAddress.SetAddress(aStream.ReadUint32L());
// Time
TTime iTime;
TInt64 time;
aStream >> time;
iTime = TTime(time);