[英]How can I create a simple text file on a windows phone (8.1) that can be accessed trough USB cable?
So as title states, I would like to create a simple text file, that I could write to from my C# application, and copy it to my PC trough an USB cable. 所以作为标题状态,我想创建一个简单的文本文件,我可以从我的C#应用程序写入,并通过USB电缆将其复制到我的PC。
Just to be clear, I would like to write a file to this place, because I can access this from my PC. 为了清楚起见,我想写一个文件到这个地方,因为我可以从我的电脑上访问它。
There is a capability for writing to the Documents folder on the phone, but adding it to your manifest would cause your app to fail the certification process in the Windows Phone Store. 可以写入手机上的“文档”文件夹,但将其添加到清单会导致您的应用程序无法通过Windows Phone应用商店中的认证过程。
The capability is called documentsLibrary
该功能称为documentsLibrary
<Capability Name="documentsLibrary" />
If you declare it, you can then read and write files in KnownFolders.DocumentsLibrary
. 如果您声明它,则可以在KnownFolders.DocumentsLibrary
读取和写入文件。
You have access to the public - documents folder from the windwsphone. 您可以从windwsphone访问public - documents文件夹。 Look at the following code-snippet (details: https://stackoverflow.com/a/15625701/2653134 ) 请查看以下代码段(详细信息: https : //stackoverflow.com/a/15625701/2653134 )
var folder = ApplicationData.Current.LocalFolder;
var file = await folder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.