Created
October 11, 2018 21:48
-
-
Save rido-min/fa2ad69ad07f2731eb62a4feb359b650 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
async static Task GetFirstAudioDevice() | |
{ | |
DeviceInformationCollection deviceInfoCollection = await DeviceInformation.FindAllAsync(DeviceClass.Location); | |
Console.WriteLine("The number of Location device:" + deviceInfoCollection.Count); | |
for (int i = 0; i < deviceInfoCollection.Count; i++) | |
{ | |
DeviceInformation deviceInfo = await DeviceInformation.CreateFromIdAsync(deviceInfoCollection[i].Id, null, deviceInfoCollection[i].Kind); | |
Console.WriteLine("The Name of {0}th of Location device: {1}", i, deviceInfo.Name); | |
} | |
Console.WriteLine("Done"); | |
} | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
GetFirstAudioDevice().Wait(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment