Hi, I have a function in a class: for each fetched record in this function I write the record to a file, I also want to add the value/count of this fetched record in my progressbar, BUT this progressbar exists in the form page and the function exists in my class, I call the function in the formpage
here is a part of this function
this.path_to_file =
ConfigurationManager.AppSettings["ExportDir"] +
DateTime.Now.ToString(ConfigurationManager.AppSettings
["Export_FileName"]) + ConfigurationManager.AppSettings
["Export_Extension"];
FileStream fm = new FileStream
(this.path_to_file, FileMode.Create, FileAccess.ReadWrite,
FileShare.ReadWrite);
StreamWriter sw = new StreamWriter(fm, Encoding.Default);
List<Export> exportRecords = null;
exportRecords = ExportList();
try
{
int i = 0;
foreach (Export ex in exportRecords)
{
sw.Write(ex.ExportLine());
sw.Write(sw.NewLine);
sw.Flush();
i++;
}
}
catch (Exception exc)
{
Log.Write(exc.Message);
}
it returns strings