Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7161335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:33:00+00:00 2026-05-28T13:33:00+00:00

Here’s what I am doing: I am logging messages and date time to a

  • 0

Here’s what I am doing:
I am logging messages and date time to a text file which I did successfully. Now I want to add the same to a Listview (or any other control which can be used to achieve this), also as and when the file is updated the Listview should be updated.

I am new to c# so excuse my lack of knowledge.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:33:00+00:00Added an answer on May 28, 2026 at 1:33 pm

    You can use FileSystemWatcher

    Instantiate an FileSystemWatcher :

    FileSystemWatcher watcher= new FileSystemWatcher();
    
    watcher.Path = @"c:\folder_that_contains_log_file";
    

    Set the notify filter : what events should be observed

    watcher.NotifyFilter= NotifyFilters.LastWrite | NotifyFilters.FileName;
    

    Specify that the FileWatcher can raise events :

    watcher.EnableRaisingEvents = true;
    

    Add event handler for the change event for all files from that folder :

    watcher.Changed += new FileSystemEventHandler(Changed);
    

    Capture the change event :

    private void Changed(object sender, FileSystemEventArgs e)
    {
    
    // Get the ful path of the file that changed and rised this change event   
    
    string fileThatChanged = e.FullPath.ToString();
    
    //Check if file that changed is your log file
    
     if (fileThatChangedPath.equals("path_tot_the_log_file"))           
     {
    
       // clear items from ListView
    
       // Read from file line by line
    
       // Add each line to the ListView
    
     }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is what I want to do: Add a CALayer as a sublayer to
Here is an example: I have a file 1.js, which has some functions. I
Here is my code, which takes two version identifiers in the form 1, 5,
Here is a simple timepicker to jQuery UI's datepicker <script type=text/javascript> /* <![CDATA[ */
Here's my situation. I have a DotNetNuke application. I want to link to an
Here's my .htaccess file: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .*
Here is my code...I have two dimensional matrices A,B. I want to develop the
here i want to understand the architecture of bluez (Bluetooth Stack Protocol). I understood
i want to parse a xhtml file and display in UITableView. what is the
Here a simple question : What do you think of code which use try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.