Adobe Air 如何检查文件夹是否存在?

发布于 2024-09-02 04:22:59 字数 86 浏览 2 评论 0原文

Adobe Air (2.0) 如何检查文件夹是否存在? (就像 Windows 上的文件夹 C:\Program Files (x86))(请需要代码示例)

Adobe Air (2.0) how to check if folder exists? (like folder C:\Program Files (x86) on windows) (code example needed, please)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陈独秀 2024-09-09 04:22:59

我认为您可以使用 File 类的以下函数:

var folder:File = File.userDirectory.resolvePath(folderPath);
folder.isDirectory;

isDirectory 属性将根据该文件夹是否存在返回一个布尔值。希望有帮助,

德布

I think you can use the following functions of the File class:

var folder:File = File.userDirectory.resolvePath(folderPath);
folder.isDirectory;

The isDirectory property will return a Boolean depending on whether or not that folder exists. Hope that helps,

debu

冰雪梦之恋 2024-09-09 04:22:59
 import flash.filesystem.File;

 var tempFold:File = File.userDirectory.resolvePath("FolderPath");

 if(tempFold.exists) 
 {
     trace("The directory exists.");
 }
 else
 {
     trace("The directory does not exists.");
 }
 import flash.filesystem.File;

 var tempFold:File = File.userDirectory.resolvePath("FolderPath");

 if(tempFold.exists) 
 {
     trace("The directory exists.");
 }
 else
 {
     trace("The directory does not exists.");
 }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文