Java me 根目录在j2me异常中不可访问

Java me 根目录在j2me异常中不可访问,java-me,j2mepolish,Java Me,J2mepolish,您提供的路径似乎不是有效的根。 要检查设备中所有有效根值的列表,请调用FileSystemRegistry的listRoots()方法 其他原因可能是由于某种原因FileSystemRegistry无法访问该路径(磁盘错误或读保护) FileConnection fc = (FileConnection)Connector.open("file:///C:/products.dat",Connector.READ_WRITE); if(!fc.exists()) { fc.create(

您提供的路径似乎不是有效的根。 要检查设备中所有有效根值的列表,请调用FileSystemRegistry的listRoots()方法

其他原因可能是由于某种原因FileSystemRegistry无法访问该路径(磁盘错误或读保护)

FileConnection fc = (FileConnection)Connector.open("file:///C:/products.dat",Connector.READ_WRITE);
if(!fc.exists())
{
    fc.create();
    OutputStream os=fc.openOutputStream();
    byte[] b=response.toString().getBytes();
    os.write(b);
    os.flush();
    fc.close();
}