////////////////接入点选择////////////////
//头文件
#include "commdb.h"
#include "cdbcols.h"
#include "apselect.h"
//库
//apengine, commdb
//代码
CCommsDatabase* CommDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
CApSelect* ApSelect = CApSelect::NewLC(*CommDb, EApIspTypeAll ,EApBearerTypeAll ,KEApSortUidAscending); //指定了ISP类型和Bearer类型,以及排序规则
if(ApSelect->MoveToFirst()){
do{
TPtrC a = ApSelect->Name(); //接入点名称
TUint uid = ApSelect->Uid();
//保存接入点名称和ID
}
while(ApSelect->MoveNext()); //下一条记录
}
/////////////////ini读写////////////////////
//头文件
#include "s32file.h"
#include "BAUTILS.H"
//库
//bafl,
//注:YOUR_ID是自定义的一个无符号整数, Default, Value是TInt类型
//读
CDictionaryFileStore* dfs = CDictionaryFileStore::OpenLC(CEikonEnv::Static()->Static()->FsSession() ,文件路径,TUid::Uid(YOUR_ID));
RDictionaryReadStream reader;
if(dfs->IsPresentL(TUid::Uid(ID))){
reader.OpenLC(*dfs,TUid::Uid(ID));
Default = reader.ReadInt32L();
CleanupStack::PopAndDestroy();
}
CleanupStack::PopAndDestroy();
//写
CDictionaryFileStore* dfs = CDictionaryFileStore::OpenLC(CEikonEnv::Static()->Static()->FsSession() ,文件路径,TUid::Uid(YOUR_ID));
RDictionaryWriteStream writer;
writer.AssignLC(*dfs,TUid::Uid(ID));
writer.WriteInt32L(Value);
writer.CommitL();
CleanupStack::PopAndDestroy();
dfs->CommitL();
CleanupStack::PopAndDestroy();