Beispiel #1
0
        static public void ConfirmIpAddressAsync()
        {
            BackgroundWorker worker = new BackgroundWorker();

            worker.DoWork += (wSender, doWorkEvent) =>
            {
                try
                {
                    NetConnUtils.ConfirmIPAddress(NetConnUtils.CurrentProxyServer, null, new JobLog());
                }
                catch (Exception ex)
                {
                    Log.LogError(ex);
                }
            };
            worker.RunWorkerCompleted += (wSender, runWorkerCompletedEvent) =>
            {
                try
                {
                    if (runWorkerCompletedEvent.Cancelled == false)
                    {
                        if (OnNetworkChekComplatedEvent != null)
                        {
                            NetworkChekComplatedEventArgs e = new NetworkChekComplatedEventArgs();
                            OnNetworkChekComplatedEvent(null, e);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Log.ShowError(ex);
                }
            };
            worker.RunWorkerAsync();
        }