Justin
Mon Sep 27 16:08:04 CDT 2004
Note reloading your form only simulates a restart, and it doesn't carry with it
all of the features of an actual process restart. If you truly need to restart
your
application, then you should probably take a good hard look at Process.Start
and the Environment class. You'll be able to get the arguments your application
was started with and pass those to a new instance of your app.
If you need synchronization between unloading/loading, you can use a Mutex
to allow your existing application to shut down and release resources required
for the second instance to completely load. A great example would be a
listening port, since two apps can't share that sort of resource.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers
"Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
news:e%23H8oTMpEHA.3464@tk2msftngp13.phx.gbl...
> If you've written your app in VB.NET it might need a slight rewrite to match
> a C# application style. But if you've written it in C#, you can put a try
> catch around the
> Application.Run(new Form1());
>
> Portion, and basically in the catch do whatever recovery you want and recall
> the above.
>
> - Sahil Malik
> You can reach me thru my blog at
>
http://www.dotnetjunkies.com/weblog/sahilmalik
>
> "Chris Calhoun" <calhoun_chris@hotmail.com> wrote in message
> news:uaBoCtKpEHA.644@tk2msftngp13.phx.gbl...
>> Does anyone know how to restart an application from itself? Or is there a
>> way to completely reload an application form code simulating a restart?
>>
>> Thanks in Advance!
>>
>>
>
>