简体   繁体   English

在Windows 8 App中将文件保存在Assets文件夹中

[英]saving file in Assets folder in Windows 8 App

I am developing an App for Windows Store. 我正在开发Windows应用商店的应用程序。 I have to save a recorded media as "file1.mp3" into the Assets folder without opening the save file prompt. 我必须将录制的媒体作为“ file1.mp3”保存到Assets文件夹中,而无需打开保存文件提示。 I used the following code 我用下面的代码

StorageFile file = await Windows.ApplicationModel.Package.Current.InstalledLocation.CreateFileAsync(@"Assets\\file1.mp3",Windows.Storage.CreationCollisionOption.ReplaceExisting);

However the system returns an "access denied" error. 但是,系统返回“访问被拒绝”错误。 The file has to be saved in the Assets directory only and I do not want to use FileSavePicker . 该文件仅必须保存在Assets目录中,并且我不想使用FileSavePicker Please Help. 请帮忙。

Thanks 谢谢

Your package folder is read-only. 您的软件包文件夹是只读的。 Use your app data folders from Windows.Storage.ApplicationData.Current instead, wherein you'll find a LocalFolder and TemporaryFolder (also RoamingFolder but an mp3 would exceed the 100KB roaming limit). 请改用Windows.Storage.ApplicationData.Current中的应用程序数据文件夹,在其中您将找到LocalFolder和TemporaryFolder(也是RoamingFolder,但mp3会超过100KB漫游限制)。 Then you can use either folder's CreateFileAsync. 然后,您可以使用任何一个文件夹的CreateFileAsync。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 FileNotFoundException从Windows应用商店应用中的Assets文件夹中读取JSON文件 - FileNotFoundException reading JSON file from Assets folder in Windows Store app 使用Windows 8获取资产文件夹并在资产文件夹中创建一个文件夹,并在创建文件夹中创建一个文件 - Get Assets Folder and create a Folder in Assets Folder and create a file in create Folder using windows 8 如何从Windows Store App Project中的Assets文件夹中获取文件? - How to get file from Assets folder in my Windows Store App Project? 在Universal App Windows 10中从.NET IDE访问Assets文件夹 - Access the Assets folder from the .NET IDE in Universal App Windows 10 无法访问位于 Windows 运行时应用程序资产文件夹中的 Zip 文件 - Cannot access Zip File located in Assets folder in Windows Runtime Apps 保存文件时访问被拒绝,Windows 8 App - Access Denied when saving a file, Windows 8 App 将RichText文档保存到Windows Store应用程序中的temp文件夹中 - Saving a RichText document to the temp folder in a Windows Store App 如何在Windows Phone 8.1 RT中将文件从Assets文件夹导出到手机的Documents文件夹? - How to export a file from the Assets folder to the phone's Documents folder in Windows Phone 8.1 RT? 将视频文件保存在特定文件夹中:Windows Form Application C# - Saving video file in a Specific Folder : Windows Form Application C# 监视文件夹并查找Windows应用程序中是否打开了文件 - Monitor a folder and find if a file is open in windows app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM