how to know the folder as write permission in air application..in my application i am saving txt file in folder,so that i need to test that folder as write permission...
如何在空中应用程序中将文件夹知道为写入权限..在我的应用程序中我将txt文件保存在文件夹中,以便我需要将该文件夹作为写入权限进行测试...
var file:File = File.desktopDirectory.resolvePath("TxtFolder/DataFile.txt");
var file:File = File.desktopDirectory.resolvePath(“TxtFolder / DataFile.txt”);
i need to check "TxtFolder" has write permission...? before saving the file(DataFile.txt)..how can i do it in flex Air as3
我需要检查“TxtFolder”是否有写权限......?在保存文件(DataFile.txt)之前..我怎么能在flex Air as3中做到这一点
Thanks In Advance...
提前致谢...
3 个解决方案
#1
You can handle ioError event which FileReference dispatches when you don't have permissions to write into directory.
当您没有写入目录的权限时,可以处理FileReference调度的ioError事件。
#2
Run the AIR app as administrator and you can even write inside system32 folder of windows. That means anywhere, just anywhere.
以管理员身份运行AIR应用程序,您甚至可以在windows的system32文件夹中编写。这意味着任何地方,任何地方。
#3
You can write to a file with AIR only if the file is under "applicationStorageDirectory". This is the only folder that has write permision.
仅当文件位于“applicationStorageDirectory”下时,才能使用AIR写入文件。这是唯一具有写入权限的文件夹。
If some know more please correct me.
如果有人知道更多,请纠正我。
#1
You can handle ioError event which FileReference dispatches when you don't have permissions to write into directory.
当您没有写入目录的权限时,可以处理FileReference调度的ioError事件。
#2
Run the AIR app as administrator and you can even write inside system32 folder of windows. That means anywhere, just anywhere.
以管理员身份运行AIR应用程序,您甚至可以在windows的system32文件夹中编写。这意味着任何地方,任何地方。
#3
You can write to a file with AIR only if the file is under "applicationStorageDirectory". This is the only folder that has write permision.
仅当文件位于“applicationStorageDirectory”下时,才能使用AIR写入文件。这是唯一具有写入权限的文件夹。
If some know more please correct me.
如果有人知道更多,请纠正我。