Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
AnswerRe: Trackbar Pin
OriginalGriff26-May-09 22:54
mveOriginalGriff26-May-09 22:54 
QuestionRead XML Data from C# Pin
QuickDeveloper26-May-09 22:24
QuickDeveloper26-May-09 22:24 
AnswerRe: Read XML Data from C# Pin
tom57200726-May-09 22:35
tom57200726-May-09 22:35 
Questionreading text file and calculating the working hours for each employee Pin
emmy_23200326-May-09 22:14
emmy_23200326-May-09 22:14 
QuestionRe: reading text file and calculating the working hours for each employee Pin
Rajesh R Subramanian26-May-09 22:22
professionalRajesh R Subramanian26-May-09 22:22 
AnswerRe: reading text file and calculating the working hours for each employee Pin
emmy_23200326-May-09 22:25
emmy_23200326-May-09 22:25 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff26-May-09 22:36
mveOriginalGriff26-May-09 22:36 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200326-May-09 22:47
emmy_23200326-May-09 22:47 
i changed it as you said but still same problem.
i think date1 should be date1 = System.Convert.ToDateTime(split[1]);
i have date1 & date2 if you misunderstand.

StreamReader reader = new StreamReader(@"C:\new.txt");
                              string line;
                              while (null != (line = reader.ReadLine()))
                              {
                                    string[] split = line.Split(new char[] { ',' });
                                    string bit = split[0];

                                    if (bit == Convert.ToString(EnrollNo))
                                    {
                                          date1 = System.Convert.ToDateTime(split[4]);
                                          //date2 = System.Convert.ToDateTime(split[2]);
                                          TimeSpan ts = new TimeSpan();
                                          date2 = Convert.ToDateTime("0:3:43");
                                          ts = date2.Subtract(date1);
                                       // time1 = split[2];
                                          listBox1.Items.Add(ts.Days + " Days " + ts.Hours + " Hours " + ts.Seconds + " Seconds ");  
                                          break;
                                       //   DateTime dtDate1 = new DateTime(2009, 30, 4, 9,44,52);
                                       // DateTime dtDate2 = new DateTime(2009, 30, 4, 17,6,27);
                                       // TimeSpan dtDiff = dtDate2 - dtDate1;
                                       //   MessageBox.Show(dtDiff.ToString());
                                          // If you want the result in No of days
                                       //   MessageBox.Show(dtDiff.Days.ToString());
                                          // Total Minutes in the TimeSpanstring
                                          // minutes = dtDiff.TotalMinutes;
                                          // Total Hours in the TimeSpanstring
                                       // int minutes = dtDiff.TotalHours;
                                
                                    }

                              }
                              reader.Dispose();
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff26-May-09 23:02
mveOriginalGriff26-May-09 23:02 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200327-May-09 0:16
emmy_23200327-May-09 0:16 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 0:48
mveOriginalGriff27-May-09 0:48 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200327-May-09 1:22
emmy_23200327-May-09 1:22 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 1:28
mveOriginalGriff27-May-09 1:28 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200327-May-09 1:36
emmy_23200327-May-09 1:36 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 1:54
mveOriginalGriff27-May-09 1:54 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 1:55
mveOriginalGriff27-May-09 1:55 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 4:29
mveOriginalGriff27-May-09 4:29 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200327-May-09 20:58
emmy_23200327-May-09 20:58 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 22:08
mveOriginalGriff27-May-09 22:08 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200328-May-09 1:11
emmy_23200328-May-09 1:11 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff28-May-09 1:24
mveOriginalGriff28-May-09 1:24 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200328-May-09 1:28
emmy_23200328-May-09 1:28 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff28-May-09 1:59
mveOriginalGriff28-May-09 1:59 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200329-May-09 23:02
emmy_23200329-May-09 23:02 
GeneralRe: reading text file and calculating the working hours for each employee Pin
Henry Minute27-May-09 0:39
Henry Minute27-May-09 0:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.