×
Namespaces

Variants
Actions

如何获得S60第五版手机型号名称

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

兼容于
文章
翻译:
hoolee
最后由 hamishwillee 在 22 Dec 2011 编辑

Contents

简介

从S60第五版开始,手机上都有一个名为product.txt的文件,位于z:\resource\versions\目录中。它包括很多关于手机的信息,格式如下::

Manufacturer=<ManufacturerName>
Model=<ModelName>
Product=<ProductCode>
Revision=<RevisionNumber>

手机型号名称可以从 z:\resource\versions\product.txt 文件中读取到。

代码示例

_LIT(KFilename,"Z:\\resource\\versions\\product.txt");
RFile file;
User::LeaveIfError(file.Open(CCoeEnv::Static()->FsSession(),KFilename,EFileRead));
CleanupClosePushL(file);
TFileText text;
text.Set(file);
TBuf16<128> szModelName;
for(TInt i=0; i<2; i++) // TFileText::Read() reads one line at a time and our model information is in the second line.
{
User::LeaveIfError(text.Read(szModelName));
}
CleanupStack::PopAndDestroy(&file);
CAknInformationNote* note = new (ELeave) CAknInformationNote(ETrue);
note->ExecuteLD(szModelName);

输出

手机型号名为如下格式: Model=5800 xPressMusic

相关链接

内部引用

This page was last modified on 22 December 2011, at 07:58.
91 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×