adobeair:在本地保存数据片段
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了adobeair:在本地保存数据片段相关的知识,希望对你有一定的参考价值。
Adobe AIR offers an ability to save small snippets of data locally (eg. users' settings). Works also on android. EncryptedLocalStore is stored encrypted using AES-CBC 128-bit method. It is not recommended to store more than 10 MB of data because of reading/decrypting speed of AIR.
// To save variable to ELS (EncryptedLocalStore) var str:String = "Bob"; var bytes:ByteArray = new ByteArray(); bytes.writeUTFBytes(str); EncryptedLocalStore.setItem("firstName", bytes); // Read it from ELS var storedValue:ByteArray = EncryptedLocalStore.getItem("firstName"); trace(storedValue.readUTFBytes(storedValue.length)); // traces "Bob" // Remove it from ELS EncryptedLocalStore.removeItem("firstName"); // Remove EVERY data from ELS EncryptedLocalStore.reset();
以上是关于adobeair:在本地保存数据片段的主要内容,如果未能解决你的问题,请参考以下文章