Blackberry 黑莓5.0检查目录内容
我的怀疑就像标题一样简单 我有一个X目录,在那里我将有一些图像,我需要在邮件中发送该目录的每个图像 不知道如何检查目录的竞争,并列出它的每个文件,这样我就可以在邮件中发送它 可能吗 提前谢谢。这个怎么样:Blackberry 黑莓5.0检查目录内容,blackberry,Blackberry,我的怀疑就像标题一样简单 我有一个X目录,在那里我将有一些图像,我需要在邮件中发送该目录的每个图像 不知道如何检查目录的竞争,并列出它的每个文件,这样我就可以在邮件中发送它 可能吗 提前谢谢。这个怎么样: try { FileConnection fconn = (FileConnection)Connector.open("file:///SDCard/X"); // If no exception is thrown, then the URI is valid, but
try {
FileConnection fconn = (FileConnection)Connector.open("file:///SDCard/X");
// If no exception is thrown, then the URI is valid, but the file may or may not exist.
if (fconn.exists() && fconn.isDirectory())
Enumeration list = fconn.list();
while (list.hasMoreElements()) {
String fname = (String)list.nextElement();
//fname could be a file or a sub-directory ...
}
fconn.close();
}
catch (IOException ioe) {
}