Error When disconnect LAN connection

Topics: Developer Forum, Project Management Forum, User Forum
Jun 24, 2008 at 8:52 AM

Hi all,

 

I have used vncsharp.dll to connect to remote computer in C# code. 

Everything is working fine. but when

1)I connect to remote computer.
2).go to control panel-->Network connection --> right click and disable LAN connection. 

code throws following exception
"RemoteDesktop must be in Connected state before calling methods that require an established connection. thrown in System.Object MarshaledInvoke(System.Windows.Forms.Control, System.Delegate, System.Object[], Boolean)    at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at VncSharp.VncClient.OnConnectionLost()
   at VncSharp.VncClient.GetRfbUpdates()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()" 

I have seen stack trace but it does not point to any one of the line.