A Progress Bar is used to show the progress of a task, so probably your task is number of file's lines.
from here you can determine number of lines : https://stackoverflow.com/questions/119559/determine-the-number-of-lines-within-a-text-file#:~:text=IO.-,File.,to%20know%20how%20many%20lines.
now that you have this, you can define a counter that after end of each loop increase by one.
//set initial value to 0
lineCounter += 1;
Progress Bar Action:
public ActionResult UpdateProgressBar(int lineCounter, int allLines)
{
var current_Progress_value = (lineCounter/allLines)*100;
//Pass the value to view
ViewBag.curr_value = current_Progress_value;
return View();
}
like above you can pass the value to the view with "viewbag"
in your controller.
and in your view:
@{
var ProgressValue = (int)ViewBag.curr_value ;
}
here is ProgressBar html code:
<div class="progress">
<div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="@ProgressValue" aria-valuemin="0" aria-valuemax="100" id="lblStatus">
</div>
</div>
hope this be right, works and help you.