消えゆく世界と流れる未来に最後の灯を since 2006/4/3
PM> Install-Package 32feet.NET
using System.Windows;
using InTheHand.Net.Sockets;
namespace WpfApplication1 {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
var btClient = new BluetoothClient();
var devs = btClient.DiscoverDevicesInRange();
foreach (BluetoothDeviceInfo dev in devs) {
listBox.Items.Add(dev.DeviceName);
}
}
}
}
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication1"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<ListBox x:Name="listBox" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</Window>