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
Yazan Ersan
NA
2
6.7k
Having a problem at TimeSpan
Jan 29 2014 2:19 PM
Hi, i created a small download manager.
I've done everything mostly, but having a small problem at timespan. I was calculating left time remaining for the download to be completed. But i'm having a problem at this point :
double secondsRemaining = ((100 - progressBar.Value) * sw.Elapsed.TotalSeconds / progressBar.Value);
TimeSpan ts = TimeSpan.FromSeconds(secondsRemaining);
What i get is "TimeSpan overflowed because the duration is too long. I've tried so many formulas, but non of them gives me the exact time left. After i edited the formula a lil bit, i found that the problem is caused by the sign "/" divide.
Thank you.
Reply
Answers (
1
)
how to assign value to dropdownlist based on selection
Switch Statements