Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my table,there are scheduled dates & in my .aspx page there is a method sendsms() which sends sms to users.

How to fire the method sendsms() on that scheduled dates ?

Please reply me as soon as possible.

Thanks & Regards
-----------------
SRIKANTH
Posted
Updated 31-Oct-10 23:30pm
v3
Comments
Dalek Dave 1-Nov-10 5:30am    
Edited for Grammar and Readability.

1 solution

You can run a thread in the backhand of the web site. This thread can send the sms in time. Or you can use windows service, which also will send the sms in time.
Example of a windows service, how you can send sms.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.IO;
using WindowsServiceDemo.Data;

namespace WindowsServiceDemo
{
    public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }
        System.Timers.Timer testTimer = new System.Timers.Timer();

        protected override void OnStart(string[] args)
        {
            testTimer.Enabled = true;
            testTimer.Interval = 1000;
            testTimer.Elapsed += new System.Timers.ElapsedEventHandler(testTimer_Elapsed);
        }
        private void testTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            /* you can check in the data base which sms should send & can send those sms */
        }

        protected override void OnStop()
        {
            testTimer.Enabled = false;
        }
    }
}
 
Share this answer
 
Comments
m@dhu 1-Nov-10 5:04am    
Good one.
Dalek Dave 1-Nov-10 5:30am    
Good Call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900