zoukankan      html  css  js  c++  java
  • (转)symbian 接入点选择 & ini文件读写

    ////////////////接入点选择////////////////

    //头文件

    #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();

  • 相关阅读:
    ASP.NET MVC4.0+ WebAPI+EasyUI+KnockOutJS快速开发框架 通用权限管理系统
    74.Java异常处理机制
    emmm
    数据库关系代数
    汇编实验二 2进制转16进制
    汇编实验一 显示字符串
    JustOj 1386: 众数的数量
    Codeforces 124A
    Codeforces 456A
    Codeforces 237A
  • 原文地址:https://www.cnblogs.com/yaoliang11/p/1789571.html
Copyright © 2011-2022 走看看