air获取系统一些位置的路径

air获取一些位置的路径:

package com.vini123
{
    import flash.display.Sprite;
    import flash.net.FileFilter;
    import flash.filesystem.File;

    public class Main extends Sprite
    {
        var _fileList:Vector. = new Vector.();
        public function Main():void
        {
            Init();
        }

        private function Init():void
        {
            var _f0:File = File.applicationDirectory;
            var _f1:File = File.applicationStorageDirectory;
            var _f2:File = File.desktopDirectory;
            var _f3:File = File.documentsDirectory;
            var _f4:File = File.userDirectory;
            var _f5:File = File.createTempDirectory();

            _fileList.push(_f0,_f1,_f2,_f3,_f4,_f5);

            for(var i:int = 0 ; i< 6; i ++)
            {
                trace(_fileList[i].nativePath);
            }

            for(i = 0 ; i< 6; i ++)
            {
                _fileList[i] = _fileList[i].resolvePath("super.xml");
                trace(_fileList[i].nativePath);
            }
        }
    }
}

输出:

E:\林林乐园\林林学习\AIR Study\小东东\还没开始\AIR读取文件路径
C:\Users\Administrator\AppData\Roaming\noName\Local Store
C:\Users\Administrator\Desktop
D:\MYDOCUMENTS
C:\Users\Administrator
C:\Users\Administrator\AppData\Local\Temp\fla448D.tmp
E:\林林乐园\林林学习\AIR Study\小东东\还没开始\AIR读取文件路径\super.xml
C:\Users\Administrator\AppData\Roaming\noName\Local Store\super.xml
C:\Users\Administrator\Desktop\super.xml
D:\MYDOCUMENTS\super.xml
C:\Users\Administrator\super.xml
C:\Users\Administrator\AppData\Local\Temp\fla448D.tmp\super.xml

 

你可能感兴趣的:(flash)