问题
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