使用UWP应用程序将文件复制到连接的Windows Phone中 [英] Copying files into connected Windows Phone by using UWP app

查看:102
本文介绍了使用UWP应用程序将文件复制到连接的Windows Phone中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我正在开发在PC上运行的Windows UWP应用程序。我要求从PC上将文件复制到USB连接的windows10手机中。

 I am developing windows UWP app which runs on PC. I have a requirement to copy files into USB connected windows10 phone from PC.

请建议我识别连接设备的解决方案是Windows Phone,然后将文件复制到该手机。

Please suggest me solution for identifying connected device is Windows Phone and then Copying files to that phone.

先谢谢。

推荐答案

嗯,有不同的方法可以做到这一点。 

Well, there are different ways to do that. 

首先你可以尝试使用
FolderPicker类
 选择手机的文件夹。然后将文件复制到其中。这是最简单的方法。

First you could try to use FolderPicker Class to select the phone's folder. Then copy the files into it. This is the simplest way.

您也可以尝试使用  KnownFolders Class  获取所有可移动设备。然后找出手机的文件夹。像这样:

You could also try to use KnownFolders Class to get all the RemovableDevices. And then find out the phone's folder. Like this:

 private async void Button_Click(object sender, RoutedEventArgs e)
        {
            StorageFolder folders = KnownFolders.RemovableDevices;

            var folderList = await folders.GetFoldersAsync();

            foreach (StorageFolder folder in folderList)
            {
                Debug.WriteLine(folder.Name);
            }
        }

祝你好运,

Roy


这篇关于使用UWP应用程序将文件复制到连接的Windows Phone中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆