Translate

2011/09/13

[轉]FLEX AIR 儲存路徑的三種選擇


資料來源:AIR 文件存储路径三种选择

1.File.desktopDirectory
路径参数:C:\Documents and Settings\当前用户名\桌面
file = File.desktopDirectory.resolvePath("HelloWorld.txt");
var stream:FileStream = new FileStream()
stream.open(file, FileMode.WRITE);
var str:String = "Congratulations on AIR Save Path ";
stream.writeUTFBytes(str);
stream.close();
2.File.applicationStorageDirectory
路径参数:C:\Documents and Settings\当前用户名\Application Data\应用程序项目名\Local Store
var file:File = File.applicationStorageDirectory.resolvePath("HelloWorld.txt");
var stream:FileStream = new FileStream()
stream.open(file, FileMode.WRITE);
var str:String = "Congratulations on AIR Save Path";
stream.writeUTFBytes(str);
stream.close();

3.File.applicationStorageDirectory
路径参数:C:\Documents and Settings\当前用户名\My Documents
var file:File = File.documentsDirectory.resolvePath("HelloWorld.txt");
var stream:FileStream = new FileStream()
stream.open(file, FileMode.WRITE);
var str:String = "Congratulations on AIR Save Path";
stream.writeUTFBytes(str);
stream.close();

沒有留言:

張貼留言

一山不容二虎之 EDBClient - Key violation 記事

關聯式資料庫裡有個很基本的特性:PRIMARY KEY 條件約束。 一個資料表只能有一個 PRIMARY KEY 條件約束,並且任何加入 PRIMARY KEY 條件約束的資料行都不可接受 Null 值。因為 PRIMARY KEY 條件約束保證唯一的資料,它們通常...