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
softairhk
NA
115
0
Problems on class writing?
Feb 18 2004 3:04 AM
Hello! I want to write a class that can get the System time, but why I can't call it from my next Windows Form class? using System; namespace ClassTester { ///
/// Summary description for TimeStamp. ///
public class TimeStamp { public TimeStamp() { // // TODO: Add constructor logic here // } public string TClock() { string TimeInString=""; int hour=DateTime.Now.Hour; int min=DateTime.Now.Minute; int sec=DateTime.Now.Second; TimeInString=(hour < 10)?"0" + hour.ToString() :hour.ToString(); TimeInString+=":" + ((min<10)?"0" + min.ToString() :min.ToString()); TimeInString+=":" + ((sec<10)?"0" + sec.ToString() :sec.ToString()); return TimeInString; } } } Please give me reply asap. Thanks!
Reply
Answers (
1
)
invalidcastexception : iconvertiable
Hashtable, ArrayList etc.