简体   繁体   中英

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.

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.

The capability is called documentsLibrary

<Capability Name="documentsLibrary" />

If you declare it, you can then read and write files in KnownFolders.DocumentsLibrary .

You have access to the public - documents folder from the windwsphone. Look at the following code-snippet (details: https://stackoverflow.com/a/15625701/2653134 )

var folder = ApplicationData.Current.LocalFolder;
    var file = await folder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM