Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string         connectionString = ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"];
            EventHubClient client           = EventHubClient.CreateFromConnectionString(connectionString, "vehiclereadings");

            FavSubscription f1 = new FavSubscription();

            f1.DeviceId               = 16;
            f1.Street                 = "Quick Detour Rd";
            f1.GPS                    = "918.055687, -32.554555";
            f1.LastUpdated            = DateTime.UtcNow;
            f1.FavHotelAvailable      = 0;
            f1.FavRestaurantAvailable = 0;
            f1.FavVenueHallAvailable  = 0;
            f1.FavZenPlaceAvailable   = 1;
            string serializedString = JsonConvert.SerializeObject(f1);

            client.Send(new EventData(Encoding.UTF8.GetBytes(serializedString)));

            f1                        = new FavSubscription();
            f1.DeviceId               = 17;
            f1.Street                 = "Dolata Lane";
            f1.GPS                    = "98.055647, 132.554555";
            f1.LastUpdated            = DateTime.UtcNow;
            f1.FavHotelAvailable      = 0;
            f1.FavRestaurantAvailable = 1;
            f1.FavVenueHallAvailable  = 0;
            f1.FavZenPlaceAvailable   = 0;
            serializedString          = JsonConvert.SerializeObject(f1);
            client.Send(new EventData(Encoding.UTF8.GetBytes(serializedString)));

            f1                        = new FavSubscription();
            f1.DeviceId               = 66;
            f1.Street                 = "as dfg Dolfghjfghjfghata Lane";
            f1.GPS                    = "98.055647, 132.554555";
            f1.LastUpdated            = DateTime.UtcNow;
            f1.FavHotelAvailable      = 0;
            f1.FavRestaurantAvailable = 1;
            f1.FavVenueHallAvailable  = 0;
            f1.FavZenPlaceAvailable   = 0;
            serializedString          = JsonConvert.SerializeObject(f1);
            client.Send(new EventData(Encoding.UTF8.GetBytes(serializedString)));

            f1                        = new FavSubscription();
            f1.DeviceId               = 18;
            f1.Street                 = "fghDolatfgha Lane";
            f1.GPS                    = "98.055647, 132.554555";
            f1.LastUpdated            = DateTime.UtcNow;
            f1.FavHotelAvailable      = 0;
            f1.FavRestaurantAvailable = 1;
            f1.FavVenueHallAvailable  = 0;
            f1.FavZenPlaceAvailable   = 0;
            serializedString          = JsonConvert.SerializeObject(f1);
            client.Send(new EventData(Encoding.UTF8.GetBytes(serializedString)));



            Console.WriteLine("Message Sent to Event Hub. Press Enter to continue");
            Console.ReadLine();
        }
Ejemplo n.º 2
0
        public void Send(TelemetryData telemetryData)
        {
            var content   = Serializers.ToJsonString(telemetryData);
            var eventData = new EventData(Encoding.UTF8.GetBytes(content));

            _eventHubClient.Send(eventData);
        }
        private void SendChatMessage(string chatText, string sessionId)
        {
            var message = new
            {
                message    = chatText,
                createDate = DateTime.UtcNow,
                username   = username,
                sessionId  = sessionId,
                messageId  = Guid.NewGuid().ToString()
            };

            try
            {
                // Use an Event Hub sender, message includes session ID as a Property
                string    jsonMessage = JsonConvert.SerializeObject(message);
                EventData eventData   = new EventData(Encoding.UTF8.GetBytes(jsonMessage));
                eventData.Properties.Add("SessionId", sessionId);
                // Optional: Provide a partitionKey value unique to each hotel. This will
                // help ensure in-order processing of chat data. If you end up having more
                // hotels than Event Hub partitions, that's ok. The data will be spread
                // throughout all partitions, and the Azure Functions that are processing
                // the data with EventProcessorHost will only process all of the events
                // within the partition.
                eventData.Properties.Add("partitionKey", hotelPartitionKey);
                eventHubClient.Send(eventData);
            }
            catch (Exception ex)
            {
                //TODO: Enable logging
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 4
0
        public void OnNext(List <Sensor> sensorData)
        {
            try
            {
                var       serializedString = JsonConvert.SerializeObject(sensorData);
                EventData data             = new EventData(Encoding.UTF8.GetBytes(serializedString))
                {
                    PartitionKey = sensorData[0].Pkey.ToString()
                };
                _eventHubClient.Send(data);

                if (!initialized)
                {
                    _logger.Write("Started sending" + serializedString + " at: " + sensorData[0].Time);
                    initialized = true;
                }
            }
            catch (MessagingException mse)
            {
                _logger.Write(mse.Message);
                if (!mse.IsTransient)
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                _logger.Write(ex);
                throw;
            }
        }
Ejemplo n.º 5
0
        static UInt64 SendToMaintHub(string jsonString, string partitionKey, string name, string type)
        {
            UInt64 sendSize = 0;

            if (maintHub != null)
            {
                EventData data = new EventData(Encoding.UTF8.GetBytes(jsonString))
                {
                    PartitionKey = partitionKey
                };
                try
                {
                    maintHub.Send(data);
                    sendSize = (UInt64)data.SerializedSizeInBytes;
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Exception sending {type} data to {name} \n     {ex.Message}\n     skipped");
                }
            }
            else
            {
                sendSize = (UInt64)EventHubREST.Send(jsonString);
            }

            sentCount++;
            updateSentBytes += sendSize;
            totalSentBytes  += sendSize;
            return(sendSize);
        }
        /// <summary>
        /// Emit the provided log event to the sink.
        /// </summary>
        /// <param name="logEvent">The log event to write.</param>
        public void Emit(LogEvent logEvent)
        {
            byte[] body;

            using (var render = new StringWriter())
            {
                _formatter.Format(logEvent, render);
                body = Encoding.UTF8.GetBytes(render.ToString());
            }

            var eventHubData = new EventData(body)
            {
#if NET45
                PartitionKey = Guid.NewGuid().ToString()
#endif
            };

            eventHubData.Properties.Add("LogItemId", Guid.NewGuid().ToString());
#if NET45
            if (_compressionTreshold != null && eventHubData.SerializedSizeInBytes > _compressionTreshold)
            {
                eventHubData = eventHubData.AsCompressed();
            }

            using (var transaction = new TransactionScope(TransactionScopeOption.Suppress))
            {
                _eventHubClient.Send(eventHubData);
            }
#else
            _eventHubClient.SendAsync(eventHubData).Wait();
#endif
        }
 public void OnNext(Payload TwitterPayloadData)
 {
     try
     {
         var serialisedString = JsonConvert.SerializeObject(TwitterPayloadData);
         if (AzureOn)
         {
             EventData data = new EventData(Encoding.UTF8.GetBytes(serialisedString))
             {
                 PartitionKey = TwitterPayloadData.Topic
             };
             _eventHubClient.Send(data);
             Console.ForegroundColor = ConsoleColor.Yellow;
             Console.WriteLine("Sending" + serialisedString + " at: " + TwitterPayloadData.CreatedAt.ToString());
         }
         else
         {
             Console.ForegroundColor = ConsoleColor.Green;
             Console.WriteLine("Faked Sending" + serialisedString + " at: " + TwitterPayloadData.CreatedAt.ToString());
         }
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            string connectionString =
                @"<eventhub connection string without EntityPath>";
            NamespaceManager namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
            string           eventHubName     = "lazhueventhub";
            EventHubClient   client           = EventHubClient.Create(eventHubName);
            int    i    = 0;
            Random rand = new Random();

            while (true)
            {
                CDRecord r = new CDRecord();
                r.id          = i;
                r.temperature = 20.1;
                r.humidity    = 68.6;
                r.createtime  = DateTime.Now;
                r.msgtype     = "thsensor";
                r.sensorID    = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x01, 0xd1, 0x17 };
                r.typeID      = rand.Next() % 4;

                var       serializedString = JsonConvert.SerializeObject(r);
                EventData data             = new EventData(Encoding.UTF8.GetBytes(serializedString));
                client.Send(data);

                Console.WriteLine("Send " + i + " message");
                System.Threading.Thread.Sleep(500);
                i++;
            }

            /*StreamReader sr = new StreamReader(@"C:\cases\117111317142938\request.json");
             * string json = sr.ReadToEnd();
             * EventData data = new EventData(Encoding.UTF8.GetBytes(json));
             * client.Send(data);*/
        }
Ejemplo n.º 9
0
        /// <summary>
        ///     Send a EventMessage message
        /// </summary>
        public static bool SendMessage(LogMessage logMessage)
        {
            try
            {
                if (Configuration.RunLocalOnly())
                {
                    EventLog.WriteEntry("Framework.Log.EventHubs", "The remote logging storage provider is not available, this GrabCaster point is configured for local only execution.", EventLogEntryType.Warning);
                    return(true);
                }

                Debug.WriteLine("LogEventUpStream - serialize log message.");
                //Create EH data message
                var jsonSerialized    = JsonConvert.SerializeObject(logMessage);
                var serializedMessage = Encoding.UTF8.GetBytes(jsonSerialized);

                var data = new EventData(serializedMessage);
                Debug.WriteLine("LogEventUpStream - send log message.");

                //Send the metric to Event Hub
                eventHubClient.Send(data);
                return(true);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("LogEventUpStream - error->{0}", ex.Message);

                EventLog.WriteEntry("Framework.Log.EventHubs", ex.Message, EventLogEntryType.Error);
                return(false);
            }
        }
Ejemplo n.º 10
0
        private void SendBatchOneEventAtATime(IEnumerable <LogEvent> events)
        {
            foreach (var logEvent in events)
            {
                var eventData = ConvertLogEventToEventData(logEvent);

                if (eventData.SerializedSizeInBytes > GetAllowedMessageSize(1))
                {
                    SelfLog.WriteLine("Message too large to send with eventhub");
                    continue;
                }

                try
                {
                    using (new TransactionScope(TransactionScopeOption.Suppress))
                    {
                        _eventHubClient.Send(eventData);
                    }
                }
                catch
                {
                    try
                    {
                        Emit(logEvent);
                    }
                    catch
                    {
                        SelfLog.WriteLine("Could not Emit message");
                    }
                }
            }
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {

            //Create the event hub
            var manager = Microsoft.ServiceBus.NamespaceManager.CreateFromConnectionString(ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"]);
            var tweethub = manager.CreateEventHubIfNotExists("TweetHubSimple");
            tweetHubClient = EventHubClient.Create(tweethub.Path);

            var oauth = CredentialsCreator_CreateFromRedirectedCallbackURL_SingleStep(ConfigurationManager.AppSettings["twitterkey"], ConfigurationManager.AppSettings["twittersecret"]);
            // Setup your credentials
            TwitterCredentials.SetCredentials(oauth.AccessToken, oauth.AccessTokenSecret, oauth.ConsumerKey, oauth.ConsumerSecret);

            
            // Access the filtered stream
            var filteredStream = Tweetinvi.Stream.CreateFilteredStream();
            filteredStream.AddTrack("globalazurebootcamp");
            filteredStream.AddTrack("azure");
            filteredStream.AddTrack("microsoft");
            filteredStream.MatchingTweetReceived += (sender, a) => {
                Console.WriteLine(a.Tweet.Text);
                var str = JsonConvert.SerializeObject(new
                {
                    Tweet = a.Tweet.Text,
                    Lang = a.Tweet.Language,
                    Created_At = a.Tweet.CreatedAt
                });
                tweetHubClient.Send(new EventData(System.Text.Encoding.UTF8.GetBytes(str)));

            };
            //filteredStream.JsonObjectReceived += (sender, json) =>
            //{
            //    ProcessTweet(json.Json);
            //};
            filteredStream.StartStreamMatchingAllConditions();
        }
Ejemplo n.º 12
0
        static void Main(string[] args)
        {
            EventHubClient client = null;

            try
            {
                if (File.Exists(_fileName))
                {
                    string auditData     = File.ReadAllText(_fileName);
                    JArray auditDataJson = JArray.Parse(auditData);
                    client = EventHubClient.CreateFromConnectionString(_connectionString, _eventHubName);

                    foreach (JObject auditEvent in auditDataJson)
                    {
                        client.Send(new EventData(Encoding.UTF8.GetBytes(auditEvent.ToString())));
                    }
                }
                else
                {
                    Console.WriteLine(string.Format("Input file {0} not found.", _fileName));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(string.Format("Upload of Azure AD Audit Data to Event Hub failed with the following error: {0}", ex.Message));
            }
            finally
            {
                if (client != null)
                {
                    client.Close();
                }
            }
        }
Ejemplo n.º 13
0
        private void SendChatMessage(string chatText, string sessionId)
        {
            var message = new
            {
                message    = chatText,
                createDate = DateTime.UtcNow,
                username   = username,
                sessionId  = sessionId,
                messageId  = Guid.NewGuid().ToString()
            };

            try
            {
                // Use an Event Hub sender, message includes session ID as a Property
                string    jsonMessage = JsonConvert.SerializeObject(message);
                EventData eventData   = new EventData(Encoding.UTF8.GetBytes(jsonMessage));
                eventData.Properties.Add("SessionId", sessionId);
                eventHubClient.Send(eventData);
            }
            catch (Exception ex)
            {
                //TODO: Enable logging
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Emit the provided log event to the sink.
        /// </summary>
        /// <param name="logEvent">The log event to write.</param>
        public void Emit(LogEvent logEvent)
        {
            byte[] body;
            using (var render = new StringWriter())
            {
                _formatter.Format(logEvent, render);
                body = Encoding.UTF8.GetBytes(render.ToString());
            }

            var eventHubData = new EventData(body)
            {
                PartitionKey = Guid.NewGuid().ToString()
            };

            _eventDataAction?.Invoke(eventHubData, logEvent);

            if (_compressionTreshold != null && eventHubData.SerializedSizeInBytes > _compressionTreshold)
            {
                eventHubData = eventHubData.AsCompressed();
            }

            using (var transaction = new TransactionScope(TransactionScopeOption.Suppress))
            {
                _eventHubClient.Send(eventHubData);
            }
        }
Ejemplo n.º 15
0
        static void SendRandomLogs(EventHubClient eventHubClient)
        {
            var    eventhubMessage = new EventHubMessage();
            string message         = "";

            var prefixBytes = new byte[16];

            random.NextBytes(prefixBytes);
            string prefix = ByteArrayToHexStringConverter.Convert(prefixBytes);

            var bytes = new byte[8];

            random.NextBytes(bytes);
            var d2CSpanId        = ByteArrayToHexStringConverter.Convert(bytes);
            var d2CCorrelationId = GenerateTraceId(prefix, d2CSpanId);

            random.NextBytes(bytes);
            var ingressSpanId        = ByteArrayToHexStringConverter.Convert(bytes);
            var ingressCorrelationId = GenerateTraceId(prefix, ingressSpanId);

            var randDeviceName = deviceNames[random.Next(deviceNames.Length)];
            var d2cLog         = GenerateD2CLogs(d2CCorrelationId, randDeviceName);
            var ingressLog     = GenerateIngressLogs(ingressCorrelationId, d2CSpanId);

            random.NextBytes(bytes);
            var egressSpanId        = ByteArrayToHexStringConverter.Convert(bytes);
            var egressCorrelationId = GenerateTraceId(prefix, egressSpanId);

            var randPointName = endpointNames[random.Next(endpointNames.Length)];
            var egressLog     = GenerateEgressLogs(egressCorrelationId, ingressSpanId, randPointName);

            eventhubMessage.records.Add(d2cLog);
            eventhubMessage.records.Add(ingressLog);
            eventhubMessage.records.Add(egressLog);

            if (SendThirdPartyLogs)
            {
                random.NextBytes(bytes);
                var thirdPartyServiceD2CSpanId        = ByteArrayToHexStringConverter.Convert(bytes);
                var thirdPartyServiceD2CCorrelationId = GenerateTraceId(prefix, thirdPartyServiceD2CSpanId);

                var randIndex    = random.Next(deviceNames.Length);
                var randEndpoint = endpointNames[randIndex];
                var randService  = serviceNames[randIndex];

                var thirdPartyServiceD2CLog = GenerateThirdPartyD2CLogs(thirdPartyServiceD2CCorrelationId, randService, randEndpoint);

                random.NextBytes(bytes);
                var thirdPartyServiceIngressSpanId        = ByteArrayToHexStringConverter.Convert(bytes);
                var thirdPartyServiceIngressCorrelationId = GenerateTraceId(prefix, thirdPartyServiceIngressSpanId);
                var thirdPartyServiceIngressLog           = GenerateThirdPartyIngressLogs(thirdPartyServiceIngressCorrelationId, thirdPartyServiceD2CSpanId, randService);

                eventhubMessage.records.Add(thirdPartyServiceD2CLog);
                eventhubMessage.records.Add(thirdPartyServiceIngressLog);
            }

            message = JsonConvert.SerializeObject(eventhubMessage);
            eventHubClient.Send(new EventData(Encoding.UTF8.GetBytes(message)));
        }
Ejemplo n.º 16
0
 public void Send(string message)
 {
     for (int i = 0; i < 100; i++)
     {
         var data = Encoding.UTF8.GetBytes($"Mesage: {message}, count={i}, date={DateTime.Now}");
         _client.Send(new EventData(data));
     }
 }
Ejemplo n.º 17
0
        private void SendMessage(string msg)
        {
            var message = $"EHProgram: {msg}";

            Console.WriteLine($"Sending message: {message}");
            _eventHubClient.Send(new EventData(Encoding.UTF8.GetBytes(message)));
            Console.WriteLine("Message Sent!");
        }
Ejemplo n.º 18
0
        public void SendMessage(string message)
        {
            EventData data = new EventData(Encoding.UTF8.GetBytes(message));

            data.Properties["time"] = DateTime.UtcNow;

            _client.Send(data);
        }
Ejemplo n.º 19
0
        static void SendToEventHubs(EventHubClient hub, XDocument xml)
        {
            Stream stream = new MemoryStream(); // Create a stream

            xml.Save(stream);                   // Save XDocument into the stream
            stream.Position = 0;

            hub.Send(new EventData(stream));
        }
Ejemplo n.º 20
0
        public static void SendToEventhub(StatusModel standData)
        {
            var       serialisedString = JsonConvert.SerializeObject(standData);
            EventData data             = new EventData(Encoding.UTF8.GetBytes(serialisedString));

            _eventHubClient.Send(data);
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("Sent: " + serialisedString);
        }
        public void OnNext(TEvent value)
        {
            var json  = JsonConvert.SerializeObject(value);
            var bytes = Encoding.UTF8.GetBytes(json);
            var data  = new EventData(bytes);

            _client.Send(data);
            Console.WriteLine(json);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Sends the supplied message to Brisk4Games
        /// </summary>
        /// <param name="message">A populated game message</param>
        public async Task Send(IngestionMessage message)
        {
            if (!isInitialized())
            {
                Initialize();
            }

            _eventHubClient.Send(new EventData(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message))));
        }
Ejemplo n.º 23
0
        public async Task TransmitImageSavedAsync(SentimentResult result)
        {
            var serialized = JsonConvert.SerializeObject(result);
            var eventData  = new EventData(Encoding.UTF8.GetBytes(serialized));

            _exceptionHandler.Run(() => _eventHubClient.Send(eventData));

            await Task.FromResult <object>(null);
        }
Ejemplo n.º 24
0
 public override bool Execute()
 {
     using (var streamReader = new StreamReader(EventData))
     {
         EventHubClient client = EventHubClient.CreateFromConnectionString(ConnectionString, EventHubPath);
         client.Send(new EventData(Encoding.UTF8.GetBytes(streamReader.ReadToEnd())));
         Log.LogMessage(MessageImportance.Normal, "Successfully sent notification to event hub path {0}.", EventHubPath);
     }
     return(true);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Publishes received message data to Event Hub
 /// </summary>
 /// <param name="eventData">Message payload</param>
 public void PublishMessages(dynamic eventData)
 {
     try
     {
         eventHubClient.Send(new EventData(Encoding.UTF8.GetBytes(Convert.ToString(eventData))));
     }
     catch (Exception ex)
     {
         Console.ForegroundColor = ConsoleColor.Red;
         Console.WriteLine("Error processing EventData - {0}", ex.Message);
     }
 }
 /// <summary>
 /// Sends json string to event hub.
 /// </summary>
 /// <param name="json">string json</param>
 public void SendJson(string json)
 {
     using (var ms = new MemoryStream())
         using (var sw = new StreamWriter(ms))
         {
             sw.Write(json);
             sw.Flush();
             ms.Position = 0;
             var eventData = new EventData(ms);
             _eventHubClient.Send(eventData);
         }
 }
Ejemplo n.º 27
0
        //------------------------------------------------------------------------------------------------------------------------
        #endregion

        #region Functions
        //------------------------------------------------------------------------------------------------------------------------
        public void PublishEvents(string msg)
        {
            //send messages to event hub client
            try
            {
                eventHubClient.Send(new EventData(Encoding.UTF8.GetBytes(msg)));
            }
            catch (Exception ex)
            {
                DebugEx.TraceError(ex.Message);
            }
        }
        /// <summary>
        ///     <see cref="SendApplicationMetadata" /> sends
        ///     <see cref="applicationMetadataEvent" /> to the Event Hub instance
        ///     associated with <see cref="eventHubClient" />.
        /// </summary>
        /// <param name="eventHubClient">
        ///     <see cref="eventHubClient" /> is the Event Hub client proxy.
        /// </param>
        /// <param name="applicationMetadataEvent">
        ///     <see cref="ApplicationMetadataEvent" /> is an event that contains metadata
        ///     originating from an imaginary up-stream web application.
        /// </param>
        /// <param name="partitionKey">
        ///     <see cref="partitionKey" /> is the Event Hub Partition Key that determines
        ///     the Event Hub Partition to which
        ///     <see cref="applicationMetadataEvent" /> will be sent.
        /// </param>
        private static void SendApplicationMetadata(EventHubClient eventHubClient,
                                                    ApplicationMetadataEvent applicationMetadataEvent, string partitionKey)
        {
            var serialisedApplicationMetadata = JsonConvert.SerializeObject(applicationMetadataEvent);

            var eventData = new EventData(Encoding.UTF8.GetBytes(serialisedApplicationMetadata))
            {
                PartitionKey = partitionKey
            };

            eventHubClient.Send(eventData);
        }
Ejemplo n.º 29
0
 /// <summary>
 ///     Send a EventMessage message
 ///     invio importantissimo perche spedisce eventi e oggetti in array bytela dimensione e strategica
 /// </summary>
 /// <param name="message"></param>
 public void SendMessage(SkeletonMessage message)
 {
     try
     {
         byte[]    byteArrayBytes = SkeletonMessage.SerializeMessage(message);
         EventData evtData        = new EventData(byteArrayBytes);
         eventHubClient.Send(evtData);
     }
     catch (Exception ex)
     {
         LogEngine.TraceError($"Error in {MethodBase.GetCurrentMethod().Name} - Error {ex.Message}");
     }
 }
Ejemplo n.º 30
0
        public override void Write(string message)
        {
            var eventData = new EventData(Encoding.Default.GetBytes(JsonConvert.SerializeObject(new LogMessageEvent()
            {
                InstanceId  = _instanceId,
                MachineName = Environment.MachineName,
                SiteName    = _siteName,
                Value       = message
            })));

            eventData.PartitionKey = _instanceId;
            _client.Send(eventData);
        }
Ejemplo n.º 31
0
 public static bool SendObject <TObject>(TObject objectToSend)
 {
     try
     {
         var jsonObject = JsonConvert.SerializeObject(objectToSend);
         eventHubClient.Send(new EventData(Encoding.UTF8.GetBytes(jsonObject)));
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }