Hi Eric,
Thanks for the response. You're right, I am using the win32 RAS, to
programmaticall y open the internet connection. I disconnect the
connection using RAS when file copying across the network is done. The
problem is on the client side, the internet connection is unreliable,
meaning anytime the connection can just drop. I simulate this by
opening the internet connection using RAS, and then manually cancelling
the connection under "Network Connections" window from admin tools.
The problem is that since the RAS connection did not disconnect
gracefully, the computer still thinks the port is open (I'm getting a
633 connection still in use error when I connect ). I'm trying to use
the Serial Port to close this open connection.
I've also tried closing it without checking if port is opened. It
tells me that it successfully closed the port, but yet the internet
connection is still there.
Eric wrote:
ri*******@gmail .com wrote:
I cannot for the life of me close the opened connection. Each time I
create a dial up connection manually on COM 1, I run this code while
the connection is open. Each time, the serialPort.IsOp en is set to
false even though the dial up connection is open.
Have you tried closing it without testing it first? Maybe do this in a
try/catch and ignore an exception that might be thrown if it was really
closed.
I bet RAS has opened the port, and .NET doesn't know that it's open.
Are you sure you want to control the port yourself? If you merely want
an internet connection you should probably go through RAS.
See here:
<http://groups.google.c om/group/microsoft.publi c.dotnet.langua ges.csharp/browse_thread/thread/e7079eeca74325f b/9b30f797a59faa5 8?lnk=st&q=RAS+ c%23+dial&rnum= 1&hl=en#9b30f79 7a59faa58>