[C #] For Windows Mobile, set the GPRS connection through code and set the network and access point

Source: Internet
Author: User

Using Microsoft. windowsmobile. configuration;

Configuration management depends on Configuration Service Providers (CSP)
Each CSP is a set of settings.
Each set has an XML

Example: CSP in the browser favorites folder
<WAP-provisioningdoc>
<Characteristic type = "browserfavorite">
<Characteristic type = "Download">
<Parm name = "url" value = "http://www.the01city.com"/>
</Characteristic>
</Characteristic>
</WAP-provisioningdoc>

You can use the following code to set the GPRS contact:

Try
{
Xmldocument xmlpreferred = new xmldocument ();
String A = getapplicationdirectory () + "// cmwap. xml ";
Xmlpreferred. Load ();

Configurationmanager. processconfiguration (xmlpreferred, true );
}
Catch (exception ER)
{
MessageBox. Show (ER. tostring ());
}

The contents of cmwap. XML are as follows:

<WAP-provisioningdoc>
<! -- GPRS connection -->
<Characteristic type = "cm_uplsentries">
<Characteristic type = "cmcc wap">
<Parm name = "destid" value = "{436ef144-b4fb-4863-a041-8f905a62c572}"/>
<Characteristic type = "devspecificcellular">
<Parm name = "maid" value = "cmwap"/>
</Characteristic>
</Characteristic>
</Characteristic>

<! -- Proxy sets proxy -->
<Characteristic type = "cm_proxyentries">
<Characteristic type = "cmcc wap Gateway">
<Parm name = "srcid" value = "{436ef144-b4fb-4863-a041-8f905a62c572}"/>
<Parm name = "destid" value = "{7022e968-5a97-4051-bc1c-4408e2fba5d9}"/>
<Parm name = "proxy" value = "10.0.0.172: 9201"/>
<Parm name = "type" value = "2"/>
</Characteristic>
<Characteristic type = "CMCC Internet proxy">
<Parm name = "srcid" value = "{436ef144-b4fb-4863-a041-8f905a62c572}"/>
<Parm name = "destid" value = "{F28D1F74-72BE-4394-A4A7-4E296219390C}"/>
<Parm name = "proxy" value = "10.0.0.172: 80"/>
<Parm name = "type" value = "1"/>
</Characteristic>
</Characteristic>
</WAP-provisioningdoc>

 

 

Http://blog.163.com/szx_rencaijob/blog/static/38447108200921905721640/

 

In addition, if you want to automatically select your network and access point When configuring "select Network", you can also select a network in XML format. You can configure cm_proxyentries.

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.