开发者

Change from C:\ to D:\ to open local files and folders?

I could use some help with a problem I've been having:

I've started building a small app with Adobe AIR, using HTML and JScript (not Flex!). I need the app to be able to o开发者_JS百科pen folders that are located on another drive than C:. Till now, I just managed to open files or folders, but they are all on the same drive as File.applicationDirectory, File.userDirectory, etc.

How can I change the path to another drive than C:\? :-)

Thanks in advance for your time (and sorry for the mistakes, I'm from Germany and it's like 4.30 in the morning :D)

Daniel

edit/concretion

Basically, I just need to change the "air.File.desktopDirectory" line to another one that lets me open D:\ :-)


Does this help?

private function getDrives():void
{
    var os:String = Capabilities.os.substr(0, 3).toLowerCase();
    var currentDrives:Array = (os == "mac") ? new File('/Volumes/').getDirectoryListing() : File.getRootDirectories();
    for each (var file:File in currentDrives)
    {
        trace("Drive: " + file.name + " Size: " + file.size);
    }
}


The problem is solved!

function volume() {
     var test = new air.File("file:///d:/");
     test.openWithDefaultApplication();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜