WEB开发网
开发学院手机开发Symbian 开发 symbian 2nd 下 J2ME 安装研究和启动方法 阅读

symbian 2nd 下 J2ME 安装研究和启动方法

 2010-03-11 16:12:00 来源:WEB开发网   
核心提示:return;}CDir* c = NULL;TFileName fullname;TBuf<100> jarPath;while(1){ds->NextL(c);if (!c)break;for (TInt i=0; iCount(); i++){const TEntry e= (*c)[i];fu

return;

}

CDir* c = NULL;

TFileName fullname;

TBuf<100> jarPath;

while(1)

{

ds->NextL(c);

if (!c)

break;

for (TInt i=0; iCount(); i++)

{

const TEntry e= (*c)[i];

fullname.Copy(ds->FullPath());

fullname.Append(e.iName);

TParsePtrC p(fullname);

if(!p.NameAndExt().Compare(KJarFile))

{

RLog::Log(fullname);

RLog::Log(p.NameAndExt());

jarPath.Copy(p.Path());

}

}

delete c;

c=NULL;

}

CleanupStack::PopAndDestroy(ds);

//读uids

RLog::Log(_L("jarPath"));

RLog::Log(jarPath); //这里得到的值为 "systemmidlets[10131ab7]\"

TBuf<100> uidsPath;

uidsPath.Append(_L("C:"));

uidsPath.Append(jarPath);

uidsPath.Append(_L("uids"));

RLog::Log(uidsPath); //到这里能正确得到C:systemmidlets[10131ab7]uids

TInt fileLength;

RFs fs;

RFile file;

fs.Connect();

file.Open(fs,uidsPath,EFileRead);

file.Size(fileLength);

RLog::Log(_L("fileLength"),fileLength);

HBufC8* heapBuf = HBufC8::NewLC(fileLength);

TPtr8 uids = heapBuf->Des();

file.Read(uids,fileLength);

RLog::Log(uids);

file.Close();

fs.Close();

//获取UID值

TBuf<8> uidBuf;

TInt i=0;

for (i=7;i>3;i--)

{

TInt aInt=0;

aInt=(TInt)uids[i];

RLog::Log(_L("aInt"),aInt);

TInt value=aInt/16;

uidBuf.Append(itoa(value));

value=aInt%16;

uidBuf.Append(itoa(value));

}

CleanupStack::PopAndDestroy();//heapBuf

Tags:symbian nd JME

编辑录入:coldstar [复制链接] [打 印]
赞助商链接