.NET Components for Mobility

Strange Question with sw.close

Last post 07-26-2008 9:47 AM by alanjmcf. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-24-2008 1:39 PM

    • K9998
    • Top 500 Contributor
    • Joined on 07-21-2008
    • Posts 2

    Strange Question with sw.close

    Hi,I'm develop an application with C# for Windows mobile 5

    After I connect to an devices (GUID service is serial port),I use this:

     

    StreamWriter sw = new StreamWriter(bluetoothClient.GetStream());
              sw.Write("AT0011111111;\r");  

              MessageBox.Show("OK!", "Success");
              sw.Close();

     

    to send a command to the devices and there is no error.

    But when I close the application and restart it to connect the same device.

     the method sw.write show error and with no detail.

    Am I forgot something when I close the application??

    Filed under: ,
  • 07-26-2008 9:47 AM In reply to

    Re: Strange Question with sw.close

    Hmm curious.  What type of device is it you're connecting too?  Maybe the device itself doesn't handle this properly.

    Also try calling bluetoothClient.Close() too, but it shouldn't be necessary.

    Finally try with a different device, for instance set-up a virtual serial port on your Win32 PC through its Bluetooth Control panel and see if it works as expected.

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
Page 1 of 1 (2 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.