⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 26.8.txt

📁 《Microsoft Visual C# .NET 2003开发技巧大全》源代码
💻 TXT
字号:
Listing 26.8 Device Discovery Using Infrared
private void mnuDevInfo_Click(object sender, System.EventArgs e)
{
IrDAClient client = new IrDAClient();
IrDADeviceInfo[] devices = client.DiscoverDevices(10);
foreach( IrDADeviceInfo device in devices )
{
AddMessage( “Found”, “DeviceID = “ + FormatDeviceID(device.DeviceID) +
“ DeviceName: “ + device.DeviceName +
“ Hints: “ + device.Hints.ToString() );
}
}
private string FormatDeviceID( byte[] deviceID )
{
string ret = “0x”;
for( int i = 0; i < 4; i++ )
{
ret += Convert.ToInt32(deviceID[i]).ToString(“X”);
}
return ret;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -