Created
January 7, 2014 13:51
-
-
Save normansolutions/8299566 to your computer and use it in GitHub Desktop.
For use on blog post: http://www.normansolutions.co.uk/post/creating-a-firefly-online-users-feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (myReader.Read()) | |
{ | |
while (myReader.Read()) | |
{ | |
DateTime loggedDate = Convert.ToDateTime(myReader["date"].ToString()); | |
if (loggedDate.AddMinutes(5) >= DateTime.Now) | |
{ | |
if (!checkForDup.Contains(myReader["Online"].ToString())) | |
{ | |
if (count < 10) | |
{ | |
sb.Append("{\"user\":\"" + myReader["Online"].ToString() + "\",\"guid\":\"" + myReader["guid"].ToString() + "\",\"logged\":\"" + loggedDate.TimeOfDay.ToString() + "\"},"); | |
checkForDup.Add(myReader["Online"].ToString()); | |
count++; | |
} | |
} | |
} | |
} | |
} | |
else | |
{ | |
sb.Append(""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment