private bool ISPreviousServiceRunningOnTheNetwork()
            {
                DiscoverableServiceDefinitionHandlingClient STXServiceClient = null;

                try
                {
                    DiscoverableServiceHandlingOperativeDefs.DiscoverableServiceDefinition serviceDefinition;
                    STXServiceClient  = new DiscoverableServiceDefinitionHandlingClient(Guid.NewGuid().ToString());
                    serviceDefinition = STXServiceClient.FindService(CNDServiceDefinitions.CNDSERVICE_PUBLIC_NAME);
                    return(true);
                }
                catch (Services.DiscoverableServiceHandling.DiscoverableServiceDefinitionHandlingSearchFailureException)
                {
                    //the service wasn't found runing on the network
                    return(false);
                }
                catch (Exception)
                {
                    return(false);
                }
                finally
                {
                    try
                    {
                        STXServiceClient.Dispose();
                    }
                    catch (Exception)
                    {
                    }
                }
            }
 public void Form1_Load(System.Object sender, System.EventArgs e)
 {
     try
     {
         string clientName = Interaction.InputBox("Define a Client Name for the Discoverable Service Emulation Client", "", "", -1, -1);
         if (!(clientName == null))
         {
             this._STXServiceClient  = new DiscoverableServiceDefinitionHandlingClient(clientName.ToUpper());
             this.txtClientName.Text = System.Convert.ToString(this._STXServiceClient.Name);
         }
         else
         {
             this.Dispose();
         }
     }
     catch (Exception)
     {
     }
 }