send text message from PC to Mobile via bluetooth in C#

旧城冷巷雨未停 提交于 2020-01-15 07:46:18

问题


I want to send text message from PC to Mobile via bluetooth and I wrote this code

private void send_text()
    { BluetoothRadio.PrimaryRadio.Mode = RadioMode.Discoverable;
        bluetoothClient = new BluetoothClient();

    for (int i = 0; i < sayi; i++)
    {                        
            InTheHand.Net.BluetoothAddress adres = this.adres_dizisi[i];
            try
            {
                bluetoothClient.Connect(new BluetoothEndPoint((BluetoothAddress)adres,service));
                // in this line error
                // socketexception was found   The requested address is not valid in its context InTheHand.Net.BluetoothEndPoint


                System.Net.Sockets.NetworkStream straem = bluetoothClient.GetStream();
                StreamWriter steramWriter = new StreamWriter(straem);

                steramWriter.WriteLine("! 0 200 200 210 1");

                // more stuff here.
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

What can I do to solve this problem?..Please help me..

来源:https://stackoverflow.com/questions/7398842/send-text-message-from-pc-to-mobile-via-bluetooth-in-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!