TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nathan R
NA
13
15.9k
Set Timer to execute a function in c# Windows Application
Mar 13 2014 1:19 AM
Sir,
I need your help.
I want to execute a function using timer at a interval of 1 hour.
Please correct this code get the function executed. Here the function:-
private void PerformTimer()
{
timer1.Start();
WebClient client = new WebClient();
string no, msg;
no = textBoxNo.Text;
msg = textBoxMSg.Text;
string baseUrl = "http://www.businesssms.co.in/sms.aspx?ID=xxxxxxx&Pwd=xxxxxxxx&PhNo=91xxxxxxxx&Text=MessageText";
Stream data = client.OpenRead(baseUrl);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
data.Close();
reader.Close();
timer1.Stop();
}
And I just called function in the onTimerEvent:-
public void OnTimerEvent(object source, EventArgs e)
{
try
{
PerformTimer();
}
catch (Exception ex)
{
MessageBox.Show(ex + "SMS02", "SMS", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
Reply
Answers (
1
)
how to add a image next to a list item in ajax combobox
c# windows application