Example #1
0
        /// <summary>
        /// Opens the URL sync.
        /// </summary>
        /// <param name="url">url to open</param>
        /// <param name="data">The data to be posted.</param>
        /// <param name="eventhandler">The event handler.</param>
        /// <param name="userToken">The user token.</param>
        public void OpenUrl(string url, string data, UploadDataCompletedEventHandler eventhandler, object userToken)
        {
            if (url.StartsWith("http", StringComparison.OrdinalIgnoreCase) == false)
            {
                url = string.Format("http://{0}", url);
            }
            UrlDelegate dc = OpenUrl;

            Asynchronous.FireAndForget(dc, url, data, eventhandler, userToken, false);
        }
Example #2
0
        /// <summary>
        /// This method is for sending out html emails asynchronously, the
        /// e-mail addresses are added into a thread-pool by the program and processed.
        /// Useful if your application need to send mass e-mails.
        /// IMPORTANT: "Async" Property for your web page has to be turned on to use this Method.
        /// </summary>
        /// <param name="message">E-mail message you want to send</param>
        /// <param name="smtpserver">smtp server for this e-mail</param>
        /// <remarks>This asynchronous method are logged at Windows EventLog (Application category) if any error. </remarks>
        public void SendEmail(MailMessage message, string smtpserver)
        {
            if (string.IsNullOrEmpty(smtpserver))
            {
                smtpserver = GridConfig.Get("WGSMTPSERVER", (string)null);
            }

            SendMailMessageDelegate dc = SendMailMessage;

            Asynchronous.FireAndForget(dc, message, smtpserver);
        }