简体   繁体   English

如何在Windows Phone(8.1)上创建一个可以通过USB线访问的简单文本文件?

[英]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.

相关问题 如何在Windows Phone 8.1中创建自定义动态磁贴? - How can I create a custom live tile in Windows Phone 8.1? 如何在Windows Phone 8.1上阅读嵌入式文本文件? - How do I read an embedded text file on Windows Phone 8.1? 如何在Windows Phone 8.1 Silverlight应用程序中创建PDF Viewer - How can i create PDF Viewer in Windows Phone 8.1 Silverlight Application 如何从PCL项目为Windows Phone 8.1创建NuGet程序包? - How can I create a NuGet package for Windows Phone 8.1 from a PCL project? 如何编写Windows Phone 8.1的RSS阅读器? - How can I write RSS reader for windows phone 8.1? 如何在Windows Phone 8.1中将系统颜色用于渐变? - How can I use a system color for gradients in Windows Phone 8.1? 如何检测Windows Phone 8.1中的屏幕被锁定/解锁? - How can I detect the screen is locked/unlocked in Windows Phone 8.1? 如何获得Windows Phone 8.1的设备唯一ID? - How can I get Device Unique Id for windows phone 8.1? 我可以创建Windows Phone 8.0类库项目并在Windows Phone 8.1项目中使用它 - Can I create Windows Phone 8.0 class library project and use that in Windows phone 8.1 project 我如何使用 c# 在 windows iot 中使用 USB 电缆作为串行端口将 arduino uno 连接到 rasberry pi 3 - how can i connect arduino uno to rasberry pi 3 using usb cable as serial port in windows iot using c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM