Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 422897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:07:36+00:00 2026-05-12T19:07:36+00:00

Previously I posted a question regarding multithreading. Actually my intension is to send SMS

  • 0

Previously I posted a question regarding multithreading. Actually my intension is to send SMS for 1000 (or more) people at a same point of time (Ex: 12:00 AM sharp) by using c# and asp.net application. Is it ok to choose multithreading concept to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:07:36+00:00Added an answer on May 12, 2026 at 7:07 pm

    That concept do not need Multi Threading …

    That concept is more of a Task Manager / Cron Job

    1. Create an ASPX Script that sees the time and executes the method you need
    2. Set up Task Manager to run this script every xx minutes
    3. Create a method, that fetches the list of persons and send the SMS through an SMS API, and call it, for ex. SendSMSFromList( List usersList, string message ) {}
    4. Now set everything up and you will run this anytime you need (just set it in the ASPX Script)

    please, fell free to tell me, if you need any code for this.


    edited for having all steps


    If you have a hosted solution, in your hosting control panel you have something as Task Schedule that you can set up to run your script page every n minutes, if so please by pass the next steps. If, by other hand, you are running your own server (IIS) then do this first.

    • Install cUrl for windows from this location and add curl.exe to C:\WINDOWS
    • Open Task Manager (Control Panel > Administrative Tools > Task Scheduler on win7)
    • Create a new task like this
    • Run the command

    curl http://localhost/yourApp/taskManager.aspx

    with this you just configured your system to run a file, just like if you execute that link in a browser, that will run every 15 minutes.

    Now we need to create that taskManager.aspx file

    public partial class taskManager : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DateTime dt = DateTime.Now;
    
            // Run after midnight
            if (dt.Hour == 0 && dt.Minute <= 15)
            {
                Write2Log("Schedule Job Started", LogType.INFO);
    
                SendSMSFromList(
                    GetUsersList(), 
                    GetSMSMessage());
    
                Write2Log("Schedule Job Finished", LogType.INFO);
            }
        }
    
        private string GetSMSMessage()
        { 
            // Fetch the text from DB...
    
            return "This is the message content that I will send as SMS"; 
        }
    
        private List<string> GetUsersList()
        { 
            // fetch the list form DB...
    
            return new List<string>(); 
        }
    
        private void SendSMSFromList(List<string> usersList, string message)
        { 
            // send SMS's
            foreach (string phoneNr in usersList)
            { 
                // send message
                mySMSAPI.Send(phoneNr, message);
            }
        }
    
        private void Write2Log(string text, LogType type)
        { 
            // Log to a file what's going on...
            try
            {
                string filename = HttpContext.Current.Server.MapPath("") + "\\status.log";
                using (StreamWriter sw = new StreamWriter(filename, true))  // open to append
                {
                    // example: 2008-12-17 13:53:10,462 INFO - Schedule Job Finished
                    string write = String.Format("{0} {1} - {2}",
                                    DateTime.Now,
                                    type.ToString(),
                                    text);
    
                    sw.WriteLine(write);
                }
            }
            catch (Exception)
            { }
        }
    
        private enum LogType
        { INFO, WARNING, ERROR }
    }
    

    Done…

    I made everything in just one file for the sake of the example, you should divide things … but what I was after was to show you the principle of it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I already posted a question regarding it, but at that time I haven't have
I previously posted a question on sharing resources across assemblies using Themes/generic.xaml and the
Yesterday, I asked this question regarding best practices for a simple information retrieval system
I know a lot of question regarding VB6 migration have been asked, but I
i'm trying to enable jboss to uses ssl protocol using a previously generated certificate
This is a follow on from my previous question although this is about something
Spring Version: 2.5.6 I want to resolve the view to a specific velocity file
The above Title is my Manager's words, not mine. :) This is a follow-up
I’m trying to wrap up a two day beat down on Abstract methods and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.