首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2ME开发 >

关于JSR75开发 怎么查到 system root name。多谢

2012-02-08 
关于JSR75开发 如何查到 system root name。急谢谢如何通过程序得到RootName:CFCard?Forexample,thefollowi

关于JSR75开发 如何查到 system root name。急谢谢
如何通过程序得到RootName:   CFCard?

For   example,   the   following   code   can   be   used   to   create   a   new   file   on   a   file   system,   where   CFCard   is   a   valid   existing   file   system   root   name   for   a   given   implementation:

  try   {
          FileConnection   fconn   =   (FileConnection)Connector.open( "file:///CFCard/newfile.txt ");
          //   If   no   exception   is   thrown,   then   the   URI   is   valid,   but   the   file   may   or   may   not   exist.
          if   (!fconn.exists())
                  fconn.create();     //   create   the   file   if   it   doesn 't   exist

          fconn.close();
  }
  catch   (IOException   ioe)   {
  }

[解决办法]
FileSystemRegistry.listRoots()
[解决办法]
被楼上的抢先了,我就来解说下吧
一般,手机存储为C: 存储卡为 E:
同时,还提供一个别名来访问,分别是 手机存储 和 存储卡
也就是说,在FileSystemRegistry.listRoots()结果中有4项
[解决办法]
不理解。支持。学习了。谢谢Lz、!
[解决办法]
顶下
[解决办法]
学习

[解决办法]
List list = new List( "List ", List.IMPLICIT);
Enumeration enumeration = FileSystemRegistry.listRoots();
if (enumeration.hasMoreElements()) {
list.append(enumeration.nextElement().toString(), null);
}
display.setCurrent(ist);

热点排行