Get the count of login datetime and username from the textfile

Posted by user2897388 on Stack Overflow See other posts from Stack Overflow or by user2897388
Published on 2013-10-19T09:08:28Z Indexed on 2013/10/19 9:54 UTC
Read the original article Hit count: 187

Filed under:

I am having a textfile with usename, userid, login and logout time. From this textfile I need to get the userid and howmany times that user logged in on that particular date. I am doing this one using C# (.NET) in windows applications. I tried this code but I am getting the whole text into the string strRead. In that strRead I need to get the count of user login basing on date.

StreamReader strmrdr = new StreamReader("Logfiles.txt");
            string strRead = strmrdr.ReadToEnd();


Username:Rajini||UserId:abc||Userlogintime:10/19/13 12:33:29 PM||UserLogoutTime:10/19/13 12:33:57 PM

Username:Rajini||UserId:abc||Userlogintime:10/19/13 12:35:29 PM||UserLogoutTime:10/19/13 12:36:57 PM

© Stack Overflow or respective owner

Related posts about c#