2013-06-26 27 views
0

我們的文件添加到StorageFolder這樣:如何在設計時將文件添加到「StorageFolder」?

StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder; 

var dataFolder = await local.CreateFolderAsync("DataFolder", 
    CreationCollisionOption.OpenIfExists); 

var file = await dataFolder.CreateFileAsync("DataFile.txt", 
CreationCollisionOption.ReplaceExisting); 

但我怎麼能添加所需的文件設計師,還有一些圖片,文字,我怎麼可以將它們添加到後來使用它們的應用程序裏面?

回答

1

只需將該文件添加到您的項目中,並確保Build Action設置爲Content

+0

謝謝@Oren,這個'Build Type'在哪裏? – user2490629

+0

哎呀 - 對不起,錯字的名稱。它實際上是「構建動作」 - 你會在屬性窗口中找到它(如果你沒有看到窗口,通常是F4)。 – Oren

+0

這是個偉大的人,這個「構建行動」是我很多問題的答案 – user2490629

相關問題