|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How do I even start debugging this.completely self taught - so bear in mind my total lack of expertise. I have a program originally written in VB2003 using the dotnet 1.1 framework. The program makes extensive use of Win32 API calls to help manage and track remote access sessions with out clients. I've left it running for days at a time on my system with no problems. It has always been stable. I recently upgraded the program to VB2005 using the upgrade wizard. It seemed to port cleanly with only minor cleanup needed (such as 2005 needing more explicit references. i.e. "if result = dialogresult.yes" becoming "if result = windows.forms.dialogresult.yes"). The problem is that under dotnet 2.0 the program is unstable. If I leave it minimized for several hours then try to acess it from the taskbar, the program form will just display as a blank white form. No actual error occurs, the form is just white. Task manager shows the process running normally. It goes to not-responding when you try to close it and has to be force closed. I have try...catch clauses around everything and as far as I can tell, no exceptions are occuring. The problem only occurs if the program has been idle for a long time. It's as if Windows has simply decided to quit drawing the form. Obviously no one can tell me exactly what's happening, my problem is that I don't have even the vaguest idea how to start debugging something like this. How do you troubleshoot a program that just hangs without causing an error? Can somebody recommend an article or website (or even a book) that gives a general debugging process for something like this? Doug,
My guess is that you are trying to update the user interface from a background thread. If you post some code we might be able to help you more. http://msdn.microsoft.com/msdnmag/issues/04/05/BasicInstincts/ Ken -------------------------------- Show quoteHide quote "Doug Robertson" wrote: > First off, I'm a hardware/OS guy. I just write code on the side and I'm > completely self taught - so bear in mind my total lack of expertise. > > I have a program originally written in VB2003 using the dotnet 1.1 > framework. The program makes extensive use of Win32 API calls to help manage > and track remote access sessions with out clients. I've left it running for > days at a time on my system with no problems. It has always been stable. > > I recently upgraded the program to VB2005 using the upgrade wizard. It > seemed to port cleanly with only minor cleanup needed (such as 2005 needing > more explicit references. i.e. "if result = dialogresult.yes" becoming "if > result = windows.forms.dialogresult.yes"). The problem is that under dotnet > 2.0 the program is unstable. If I leave it minimized for several hours then > try to acess it from the taskbar, the program form will just display as a > blank white form. No actual error occurs, the form is just white. Task > manager shows the process running normally. It goes to not-responding when > you try to close it and has to be force closed. I have try...catch clauses > around everything and as far as I can tell, no exceptions are occuring. The > problem only occurs if the program has been idle for a long time. It's as if > Windows has simply decided to quit drawing the form. > > Obviously no one can tell me exactly what's happening, my problem is that I > don't have even the vaguest idea how to start debugging something like this. > How do you troubleshoot a program that just hangs without causing an error? > > Can somebody recommend an article or website (or even a book) that gives a > general debugging process for something like this? Ken,
As I mentioned, I'm a hardware guy. I don't even know what "update the user interface from a background thread" means. I'm not deliberately creating seperate threads. Basically there is a startup module that sets some global parameters and structures then displays frmMain. Any threads that are created are dotnet's doing. What part of the code would you find useful? I'm clueless here :) As far as I know, my code should be doing absolutely nothing when the program is minimized. There IS a timer that does an API call every few seconds to check for dropped RAS connections, but it always worked under vb2003 and I've gone so far as to remove the timer control and associated timer1_tick procedure from the vb2005 version with no effect. Here's an overview. The main form has two main sections. A tree view on the left side and a panel area on the right side. Different panels are displayed depending on where you are in the tree. The tree contains a list of our clients and under each client a list of their systems. Each client has a RAS (VPN) phonebook entry associated with them. Basically you select a system from the tree view and click a "connect" button. The program makes the VPN connection then starts an RDP session to the selected system. When the RDP session terminates, it disconnects the VPN and adds and entry to a logbook file. Most of the code involves adding and deleting clients and systems to/from the tree and setting various connection options. The core of the program is just a wrapper around API calls that do the real work. Show quoteHide quote "Ken Tucker [MVP]" wrote: > Doug, > > My guess is that you are trying to update the user interface from a > background thread. If you post some code we might be able to help you more. > > http://msdn.microsoft.com/msdnmag/issues/04/05/BasicInstincts/ > > Ken > -------------------------------- > > "Doug Robertson" wrote: > > > First off, I'm a hardware/OS guy. I just write code on the side and I'm > > completely self taught - so bear in mind my total lack of expertise. > > > > I have a program originally written in VB2003 using the dotnet 1.1 > > framework. The program makes extensive use of Win32 API calls to help manage > > and track remote access sessions with out clients. I've left it running for > > days at a time on my system with no problems. It has always been stable. > > > > I recently upgraded the program to VB2005 using the upgrade wizard. It > > seemed to port cleanly with only minor cleanup needed (such as 2005 needing > > more explicit references. i.e. "if result = dialogresult.yes" becoming "if > > result = windows.forms.dialogresult.yes"). The problem is that under dotnet > > 2.0 the program is unstable. If I leave it minimized for several hours then > > try to acess it from the taskbar, the program form will just display as a > > blank white form. No actual error occurs, the form is just white. Task > > manager shows the process running normally. It goes to not-responding when > > you try to close it and has to be force closed. I have try...catch clauses > > around everything and as far as I can tell, no exceptions are occuring. The > > problem only occurs if the program has been idle for a long time. It's as if > > Windows has simply decided to quit drawing the form. > > > > Obviously no one can tell me exactly what's happening, my problem is that I > > don't have even the vaguest idea how to start debugging something like this. > > How do you troubleshoot a program that just hangs without causing an error? > > > > Can somebody recommend an article or website (or even a book) that gives a > > general debugging process for something like this? > Obviously no one can tell me exactly what's happening, my problem is that I You might create a simple log system. Whenever you're about to perform> don't have even the vaguest idea how to start debugging something like this. > How do you troubleshoot a program that just hangs without causing an error? an action you could write to a file (or database or something else) that says what the action is and what the current time is. You could even start out vague, like writing a line whenever you enter a method or property, and then after finding which sub has the problem, use this same method for each line in the sub. The bad part is that this will tell you where you had a problem (or at least what the last command to execute was) but it won't tell you what the problem was. > As I mentioned, I'm a hardware guy. I don't even know what "update the user Basically, the User Interface (UI) thread creates all the controls on> interface from a background thread" means. your form. It is the only thread that is allowed to change any of the properties of the controls it created. If any other thread tries to change those properties the program will throw a cross-thread exception. The article Ken mentioned describes the "proper" way to get around this. If you need to know more please let us know and we'll try to explain. Thanks, Seth Rowe Doug Robertson wrote: Show quoteHide quote > Ken, > > As I mentioned, I'm a hardware guy. I don't even know what "update the user > interface from a background thread" means. > > I'm not deliberately creating seperate threads. Basically there is a startup > module that sets some global parameters and structures then displays frmMain. > Any threads that are created are dotnet's doing. > > What part of the code would you find useful? I'm clueless here :) > > As far as I know, my code should be doing absolutely nothing when the > program is minimized. There IS a timer that does an API call every few > seconds to check for dropped RAS connections, but it always worked under > vb2003 and I've gone so far as to remove the timer control and associated > timer1_tick procedure from the vb2005 version with no effect. > > Here's an overview. The main form has two main sections. A tree view on the > left side and a panel area on the right side. Different panels are displayed > depending on where you are in the tree. > > The tree contains a list of our clients and under each client a list of > their systems. Each client has a RAS (VPN) phonebook entry associated with > them. > > Basically you select a system from the tree view and click a "connect" > button. The program makes the VPN connection then starts an RDP session to > the selected system. When the RDP session terminates, it disconnects the VPN > and adds and entry to a logbook file. > > Most of the code involves adding and deleting clients and systems to/from > the tree and setting various connection options. The core of the program is > just a wrapper around API calls that do the real work. > > > "Ken Tucker [MVP]" wrote: > > > Doug, > > > > My guess is that you are trying to update the user interface from a > > background thread. If you post some code we might be able to help you more. > > > > http://msdn.microsoft.com/msdnmag/issues/04/05/BasicInstincts/ > > > > Ken > > -------------------------------- > > > > "Doug Robertson" wrote: > > > > > First off, I'm a hardware/OS guy. I just write code on the side and I'm > > > completely self taught - so bear in mind my total lack of expertise. > > > > > > I have a program originally written in VB2003 using the dotnet 1.1 > > > framework. The program makes extensive use of Win32 API calls to help manage > > > and track remote access sessions with out clients. I've left it running for > > > days at a time on my system with no problems. It has always been stable. > > > > > > I recently upgraded the program to VB2005 using the upgrade wizard. It > > > seemed to port cleanly with only minor cleanup needed (such as 2005 needing > > > more explicit references. i.e. "if result = dialogresult.yes" becoming "if > > > result = windows.forms.dialogresult.yes"). The problem is that under dotnet > > > 2.0 the program is unstable. If I leave it minimized for several hours then > > > try to acess it from the taskbar, the program form will just display as a > > > blank white form. No actual error occurs, the form is just white. Task > > > manager shows the process running normally. It goes to not-responding when > > > you try to close it and has to be force closed. I have try...catch clauses > > > around everything and as far as I can tell, no exceptions are occuring. The > > > problem only occurs if the program has been idle for a long time. It's as if > > > Windows has simply decided to quit drawing the form. > > > > > > Obviously no one can tell me exactly what's happening, my problem is that I > > > don't have even the vaguest idea how to start debugging something like this. > > > How do you troubleshoot a program that just hangs without causing an error? > > > > > > Can somebody recommend an article or website (or even a book) that gives a > > > general debugging process for something like this? I like the log file idea. At least it might point me to the right procedure.
Thanks. Show quoteHide quote "rowe_newsgroups" wrote: > > Obviously no one can tell me exactly what's happening, my problem is that I > > don't have even the vaguest idea how to start debugging something like this. > > How do you troubleshoot a program that just hangs without causing an error? > > You might create a simple log system. Whenever you're about to perform > an action you could write to a file (or database or something else) > that says what the action is and what the current time is. You could > even start out vague, like writing a line whenever you enter a method > or property, and then after finding which sub has the problem, use this > same method for each line in the sub. The bad part is that this will > tell you where you had a problem (or at least what the last command to > execute was) but it won't tell you what the problem was. > > > As I mentioned, I'm a hardware guy. I don't even know what "update the user > > interface from a background thread" means. > > Basically, the User Interface (UI) thread creates all the controls on > your form. It is the only thread that is allowed to change any of the > properties of the controls it created. If any other thread tries to > change those properties the program will throw a cross-thread > exception. The article Ken mentioned describes the "proper" way to get > around this. If you need to know more please let us know and we'll try > to explain. > > Thanks, > > Seth Rowe > > > Doug Robertson wrote: > > Ken, > > > > As I mentioned, I'm a hardware guy. I don't even know what "update the user > > interface from a background thread" means. > > > > I'm not deliberately creating seperate threads. Basically there is a startup > > module that sets some global parameters and structures then displays frmMain. > > Any threads that are created are dotnet's doing. > > > > What part of the code would you find useful? I'm clueless here :) > > > > As far as I know, my code should be doing absolutely nothing when the > > program is minimized. There IS a timer that does an API call every few > > seconds to check for dropped RAS connections, but it always worked under > > vb2003 and I've gone so far as to remove the timer control and associated > > timer1_tick procedure from the vb2005 version with no effect. > > > > Here's an overview. The main form has two main sections. A tree view on the > > left side and a panel area on the right side. Different panels are displayed > > depending on where you are in the tree. > > > > The tree contains a list of our clients and under each client a list of > > their systems. Each client has a RAS (VPN) phonebook entry associated with > > them. > > > > Basically you select a system from the tree view and click a "connect" > > button. The program makes the VPN connection then starts an RDP session to > > the selected system. When the RDP session terminates, it disconnects the VPN > > and adds and entry to a logbook file. > > > > Most of the code involves adding and deleting clients and systems to/from > > the tree and setting various connection options. The core of the program is > > just a wrapper around API calls that do the real work. > > > > > > "Ken Tucker [MVP]" wrote: > > > > > Doug, > > > > > > My guess is that you are trying to update the user interface from a > > > background thread. If you post some code we might be able to help you more. > > > > > > http://msdn.microsoft.com/msdnmag/issues/04/05/BasicInstincts/ > > > > > > Ken > > > -------------------------------- > > > > > > "Doug Robertson" wrote: > > > > > > > First off, I'm a hardware/OS guy. I just write code on the side and I'm > > > > completely self taught - so bear in mind my total lack of expertise. > > > > > > > > I have a program originally written in VB2003 using the dotnet 1.1 > > > > framework. The program makes extensive use of Win32 API calls to help manage > > > > and track remote access sessions with out clients. I've left it running for > > > > days at a time on my system with no problems. It has always been stable. > > > > > > > > I recently upgraded the program to VB2005 using the upgrade wizard. It > > > > seemed to port cleanly with only minor cleanup needed (such as 2005 needing > > > > more explicit references. i.e. "if result = dialogresult.yes" becoming "if > > > > result = windows.forms.dialogresult.yes"). The problem is that under dotnet > > > > 2.0 the program is unstable. If I leave it minimized for several hours then > > > > try to acess it from the taskbar, the program form will just display as a > > > > blank white form. No actual error occurs, the form is just white. Task > > > > manager shows the process running normally. It goes to not-responding when > > > > you try to close it and has to be force closed. I have try...catch clauses > > > > around everything and as far as I can tell, no exceptions are occuring. The > > > > problem only occurs if the program has been idle for a long time. It's as if > > > > Windows has simply decided to quit drawing the form. > > > > > > > > Obviously no one can tell me exactly what's happening, my problem is that I > > > > don't have even the vaguest idea how to start debugging something like this. > > > > How do you troubleshoot a program that just hangs without causing an error? > > > > > > > > Can somebody recommend an article or website (or even a book) that gives a > > > > general debugging process for something like this? > >
Show quote
Hide quote
> The tree contains a list of our clients and under each client a list of Could it be a network timeout issue? I have seen big delays when domain> their systems. Each client has a RAS (VPN) phonebook entry associated with > them. > > Basically you select a system from the tree view and click a "connect" > button. The program makes the VPN connection then starts an RDP session to > the selected system. When the RDP session terminates, it disconnects the > VPN > and adds and entry to a logbook file. > > Most of the code involves adding and deleting clients and systems to/from > the tree and setting various connection options. The core of the program > is > just a wrapper around API calls that do the real work. servers get bogged down. Are you checking the API hResults properly? There are many differences between them. Some <> 0, sometimes negative numbers are bad, sometimes <32 is bad, etc. Is the problem intermittant? or does it lock up every time? Get ProcessExplorer from SysInternals.Com. Be sure you are not leaking connections, threads, handles, or anything else. Also, get TCP view from there, and check your process. Maybe it is a client problem on one of the workstations. Can you test this locally? IE two machines in arms reach, where this can be replicated? With no other connections. And you are sure the ONLY difference is VS2005? Why would you upgrade if you didn't need to?
The program was stable on 03 right? Show quoteHide quote "Doug Robertson" <DougRobert***@discussions.microsoft.com> wrote in message news:BFB56F36-4374-4452-B09D-BE82C6C8B840@microsoft.com... > First off, I'm a hardware/OS guy. I just write code on the side and I'm > completely self taught - so bear in mind my total lack of expertise. > > I have a program originally written in VB2003 using the dotnet 1.1 > framework. The program makes extensive use of Win32 API calls to help > manage > and track remote access sessions with out clients. I've left it running > for > days at a time on my system with no problems. It has always been stable. > > I recently upgraded the program to VB2005 using the upgrade wizard. It > seemed to port cleanly with only minor cleanup needed (such as 2005 > needing > more explicit references. i.e. "if result = dialogresult.yes" becoming "if > result = windows.forms.dialogresult.yes"). The problem is that under > dotnet > 2.0 the program is unstable. If I leave it minimized for several hours > then > try to acess it from the taskbar, the program form will just display as a > blank white form. No actual error occurs, the form is just white. Task > manager shows the process running normally. It goes to not-responding when > you try to close it and has to be force closed. I have try...catch clauses > around everything and as far as I can tell, no exceptions are occuring. > The > problem only occurs if the program has been idle for a long time. It's as > if > Windows has simply decided to quit drawing the form. > > Obviously no one can tell me exactly what's happening, my problem is that > I > don't have even the vaguest idea how to start debugging something like > this. > How do you troubleshoot a program that just hangs without causing an > error? > > Can somebody recommend an article or website (or even a book) that gives a > general debugging process for something like this? Good question.
Partly just to gain experience with vb2005. But I also want to add some capability that I can only do (easily) with the 2.0 framework. One of the proposed enhancement would require me to know the sessionid the program is running under but process.sessionid is not available in the 1.1 framework. I also want to make some changes to the call logging system which will be most easily accomplished by using an unbound datagridview control. A control that's not available in vb2003. Show quoteHide quote "Jeff Allan" wrote: > Why would you upgrade if you didn't need to? > The program was stable on 03 right? > > "Doug Robertson" <DougRobert***@discussions.microsoft.com> wrote in message > news:BFB56F36-4374-4452-B09D-BE82C6C8B840@microsoft.com... > > First off, I'm a hardware/OS guy. I just write code on the side and I'm > > completely self taught - so bear in mind my total lack of expertise. > > > > I have a program originally written in VB2003 using the dotnet 1.1 > > framework. The program makes extensive use of Win32 API calls to help > > manage > > and track remote access sessions with out clients. I've left it running > > for > > days at a time on my system with no problems. It has always been stable. > > > > I recently upgraded the program to VB2005 using the upgrade wizard. It > > seemed to port cleanly with only minor cleanup needed (such as 2005 > > needing > > more explicit references. i.e. "if result = dialogresult.yes" becoming "if > > result = windows.forms.dialogresult.yes"). The problem is that under > > dotnet > > 2.0 the program is unstable. If I leave it minimized for several hours > > then > > try to acess it from the taskbar, the program form will just display as a > > blank white form. No actual error occurs, the form is just white. Task > > manager shows the process running normally. It goes to not-responding when > > you try to close it and has to be force closed. I have try...catch clauses > > around everything and as far as I can tell, no exceptions are occuring. > > The > > problem only occurs if the program has been idle for a long time. It's as > > if > > Windows has simply decided to quit drawing the form. > > > > Obviously no one can tell me exactly what's happening, my problem is that > > I > > don't have even the vaguest idea how to start debugging something like > > this. > > How do you troubleshoot a program that just hangs without causing an > > error? > > > > Can somebody recommend an article or website (or even a book) that gives a > > general debugging process for something like this? > > > Hmmmm, I thought this was a winform app. In that case, there's a process ID
that you can get using the process class (available also in the 1.1 version of the framework and vs2003). I'm only assuming that's what you want though. Check it out. Steve Show quoteHide quote "Doug Robertson" <DougRobert***@discussions.microsoft.com> wrote in message news:18F5CE70-C599-4F59-9ABD-1B018CEA3532@microsoft.com... > Good question. > Partly just to gain experience with vb2005. But I also want to add some > capability that I can only do (easily) with the 2.0 framework. One of the > proposed enhancement would require me to know the sessionid the program is > running under but process.sessionid is not available in the 1.1 framework. > I > also want to make some changes to the call logging system which will be > most > easily accomplished by using an unbound datagridview control. A control > that's not available in vb2003. > > "Jeff Allan" wrote: > >> Why would you upgrade if you didn't need to? >> The program was stable on 03 right? >> >> "Doug Robertson" <DougRobert***@discussions.microsoft.com> wrote in >> message >> news:BFB56F36-4374-4452-B09D-BE82C6C8B840@microsoft.com... >> > First off, I'm a hardware/OS guy. I just write code on the side and I'm >> > completely self taught - so bear in mind my total lack of expertise. >> > >> > I have a program originally written in VB2003 using the dotnet 1.1 >> > framework. The program makes extensive use of Win32 API calls to help >> > manage >> > and track remote access sessions with out clients. I've left it running >> > for >> > days at a time on my system with no problems. It has always been >> > stable. >> > >> > I recently upgraded the program to VB2005 using the upgrade wizard. It >> > seemed to port cleanly with only minor cleanup needed (such as 2005 >> > needing >> > more explicit references. i.e. "if result = dialogresult.yes" becoming >> > "if >> > result = windows.forms.dialogresult.yes"). The problem is that under >> > dotnet >> > 2.0 the program is unstable. If I leave it minimized for several hours >> > then >> > try to acess it from the taskbar, the program form will just display as >> > a >> > blank white form. No actual error occurs, the form is just white. Task >> > manager shows the process running normally. It goes to not-responding >> > when >> > you try to close it and has to be force closed. I have try...catch >> > clauses >> > around everything and as far as I can tell, no exceptions are occuring. >> > The >> > problem only occurs if the program has been idle for a long time. It's >> > as >> > if >> > Windows has simply decided to quit drawing the form. >> > >> > Obviously no one can tell me exactly what's happening, my problem is >> > that >> > I >> > don't have even the vaguest idea how to start debugging something like >> > this. >> > How do you troubleshoot a program that just hangs without causing an >> > error? >> > >> > Can somebody recommend an article or website (or even a book) that >> > gives a >> > general debugging process for something like this? >> >> >> Processid yes. I need the sessionid. Sessionid lets me know which session in
a multi-user envionment (Such as terminal server or fast user switching in XP) the program is running in. I haven't figured out any way to retrieve that under 1.1 Show quoteHide quote "Steve Long" wrote: > Hmmmm, I thought this was a winform app. In that case, there's a process ID > that you can get using the process class (available also in the 1.1 version > of the framework and vs2003). I'm only assuming that's what you want though. > Check it out. > > Steve > > "Doug Robertson" <DougRobert***@discussions.microsoft.com> wrote in message > news:18F5CE70-C599-4F59-9ABD-1B018CEA3532@microsoft.com... > > Good question. > > Partly just to gain experience with vb2005. But I also want to add some > > capability that I can only do (easily) with the 2.0 framework. One of the > > proposed enhancement would require me to know the sessionid the program is > > running under but process.sessionid is not available in the 1.1 framework. > > I > > also want to make some changes to the call logging system which will be > > most > > easily accomplished by using an unbound datagridview control. A control > > that's not available in vb2003. > > > > "Jeff Allan" wrote: > > > >> Why would you upgrade if you didn't need to? > >> The program was stable on 03 right? > >> > >> "Doug Robertson" <DougRobert***@discussions.microsoft.com> wrote in > >> message > >> news:BFB56F36-4374-4452-B09D-BE82C6C8B840@microsoft.com... > >> > First off, I'm a hardware/OS guy. I just write code on the side and I'm > >> > completely self taught - so bear in mind my total lack of expertise. > >> > > >> > I have a program originally written in VB2003 using the dotnet 1.1 > >> > framework. The program makes extensive use of Win32 API calls to help > >> > manage > >> > and track remote access sessions with out clients. I've left it running > >> > for > >> > days at a time on my system with no problems. It has always been > >> > stable. > >> > > >> > I recently upgraded the program to VB2005 using the upgrade wizard. It > >> > seemed to port cleanly with only minor cleanup needed (such as 2005 > >> > needing > >> > more explicit references. i.e. "if result = dialogresult.yes" becoming > >> > "if > >> > result = windows.forms.dialogresult.yes"). The problem is that under > >> > dotnet > >> > 2.0 the program is unstable. If I leave it minimized for several hours > >> > then > >> > try to acess it from the taskbar, the program form will just display as > >> > a > >> > blank white form. No actual error occurs, the form is just white. Task > >> > manager shows the process running normally. It goes to not-responding > >> > when > >> > you try to close it and has to be force closed. I have try...catch > >> > clauses > >> > around everything and as far as I can tell, no exceptions are occuring. > >> > The > >> > problem only occurs if the program has been idle for a long time. It's > >> > as > >> > if > >> > Windows has simply decided to quit drawing the form. > >> > > >> > Obviously no one can tell me exactly what's happening, my problem is > >> > that > >> > I > >> > don't have even the vaguest idea how to start debugging something like > >> > this. > >> > How do you troubleshoot a program that just hangs without causing an > >> > error? > >> > > >> > Can somebody recommend an article or website (or even a book) that > >> > gives a > >> > general debugging process for something like this? > >> > >> > >> > > > Doug Robertson wrote:
> I have a program originally written in VB2003 using the dotnet 1.1 Doug,> framework. The program makes extensive use of Win32 API calls to help manage > and track remote access sessions with out clients. I've left it running for > days at a time on my system with no problems. It has always been stable. I have written an almost identical application in VB2005. Here is the code I use to start a RAS VPN connection and launch either the RDP client or VNC: Dim spVPN As New Process() With spVPN .StartInfo.FileName = oSettings.RASDialPath .StartInfo.UseShellExecute = False .StartInfo.RedirectStandardOutput = True .StartInfo.WindowStyle = ProcessWindowStyle.Hidden .StartInfo.CreateNoWindow = True .StartInfo.Arguments = VPNargs .Start() sOut = spVPN.StandardOutput.ReadToEnd .WaitForExit(1000) Application.DoEvents() ec = .ExitCode End With If Not spVPN Is Nothing Then spVPN.Close() Debug.Print("exit code: [" & CStr(ec) & "]" & vbCrLf & sOut) If ec = 0 Then Dim sp As New Process() With sp .StartInfo.FileName = launchApp .StartInfo.UseShellExecute = False .StartInfo.WorkingDirectory = My.Application.Info.DirectoryPath .StartInfo.Arguments = launchCMD .Start() .WaitForExit(1000) Application.DoEvents() End With If Not sp Is Nothing Then sp.Close() Else Select Case ec Case 623 MsgBox("Support RAS phonebook entry not found.", MsgBoxStyle.OkOnly, "Connection Error") Case Else MsgBox(sOut, MsgBoxStyle.OkOnly, "Connection Error") End Select End If It uses a dummy RAS connectoid (the the right security/VPN settings) that you can call with rasdial and command line switches. One thing I have noticed is that RAS dial/hangup is very sensitive to trying to 'rush' it when hanging up. Any help?
User Interface Design - Books?
Need for Speed naming conventions forced by VS.NET? Attribute instantiation Can a Decimal variable be set to "Not a Number" find number in a string Trouble displaying info from access db I need 2-3 books on VB.NET, Office automation. Any suggestions? DataGridView1 (VS2005) Multi line grid row with .net compact framework 2.0 |
|||||||||||||||||||||||