Hi, I'm still fairly new to .NET, but I want to create an eventlog viewer using C#. Attached at the bottom is some code I've already written. My problem is that I can't match the performance of the Windows NT eventview for reading the application event log. I can read a remote machine's app log in seconds, but my code takes over a minute to read the same information. How can I improve my code? Someone out there must have tried already? Or should I just give up and use a diffent language (C++)? If I try a listBox (rather than listView), I get a small improvement, but nothing to match the eventviewer. What am I doing wrong? I am the only one trying this? If Microsoft in the future will be using C# to build their OS, will they be using the eventlog class and a listView control, if so how will they achieve acceptable perform?
Is there a good book out there that would help? Any help would be much appricated. Simon (frustrated and about to give up...) Code snippet* | | V private void GetEventlog() { int rowcount = 0; EventLog NTIlog = new EventLog("Application",CurMachine); for(int i = 0; i < NTIlog.Entries.Count; i++) { if(NTIlog.Entries[i].Source.ToString() == "PontisInstallAgent") { ListViewItem item = listView1.Items.Add(NTIlog.Entries[i].TimeGenerated.ToString()); switch(NTIlog.Entries[i].EntryType.ToString()) { case "Error" : item.BackColor = Color.Red; item.ForeColor = Color.White; break; case "Warning" : item.BackColor = Color.Yellow; item.ForeColor = Color.Black; break; default : item.BackColor = Color.White; item.ForeColor = Color.Black; break; } item.SubItems.Add(NTIlog.Entries[i].EntryType.ToString()); item.SubItems.Add(NTIlog.Entries[i].Message); } } foreach(ColumnHeader col in listView1.Columns) { col.Width = -2; } NTIlog.Close(); } ---------------------------------------------------------------------- If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. ---------------------------------------------------------------------- You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.