KnownFolders.DocumentsLibrary | documentsLibrary property
Windows.Storage.KnownFolders.documentsLibrary が返す値は、StorageFolder class で、
ユーザーのドキュメントフォルダに作成されます
StorageFolder class
createFileAsync メソッドでファイルを作成しますが、CreationCollisionOption を指定
しないメソッドを使うと、"ファイル名 (2)" というような名前で作成されます
createFileAsync(String, CreationCollisionOption) method
function scenario1CreateFile() {
//Create a empty file sample.txt in user's Document folder, replacing/overwrite the existing file to ensure there is only file be created.
Windows.Storage.KnownFolders.documentsLibrary.createFileAsync("sample.txt",
Windows.Storage.CreationCollisionOption.replaceExisting).then(function (file) {
id("scenario1Output").innerHTML = '<p>The file <b>sample.txt</b> was created.</p>';
sampleFile = file;
});
}
.then の中にある file の内容を以下の画像で示しています
StorageFile class
posted by
at 2011-10-25 14:54
|
Comment(0)
|
オワコン
|

|