) Symbian Access Point Selection & INI file read/write

Source: Internet
Author: User

/// // Select the Access Point ////////////////

// Header file

# Include "commdb. H"
# Include "cdbcols. H"
# Include "apselect. H"

// Database

// Apengine, commdb

//Code

Ccommsdatabase * commdb = ccommsdatabase: newl (edatabasetypeiap );
Capselect * apselect = capselect: newlc (* commdb, eapisptypeall, eapbearertypeall, keapsortuidascending); // the ISP and bearer types and sorting rules are specified.
If (apselect-> movetofirst ()){
Do {
Tptrc A = apselect-> name (); // Access Point name
Tuint uid = apselect-> UID ();
// Save the Access Point name and ID

}
While (apselect-> movenext (); // The next record

}

/// // Ini read/write ////////////////////

// Header file

# Include "s32file. H"
# Include "bautils. H"

// Database

// Bafl,

// Note: your_id is a custom unsigned integer, default, and value is of the tint type.

// Read

Cdictionaryfilestore * DFS = cdictionaryfilestore: openlc (ceikonenv: static ()-> fssession (), file path, 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 ();

// Write

Cdictionaryfilestore * DFS = cdictionaryfilestore: openlc (ceikonenv: static ()-> fssession (), file path, tuid: UID (your_id ));
Rdictionarywritestream writer;
Writer. assignlc (* DFS, tuid: UID (ID ));
Writer. writeint32l (value );
Writer. commitl ();
Cleanupstack: popanddestroy ();

DFS-> commitl ();
Cleanupstack: popanddestroy ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.