First i must say i am sorry for the repost. I noticed to late that i forgot
to add text in the subject field.
I made a class that has one purpose. That is to read a log file into an
array and provide methods to get a random line. In the code below I am using
GetHeaderFromFiles to build up the array. In getDateStart i am picking out
line 2 from the array. When i in some form try to set a textbox.text like
this it does not work :
-----------------------------------------
LogHead test = new LogHead();
txtDate.Text = test.getDateStart();
-------------------------------------------
Here is the class LogHead
public static string GetHeaderFromFile(string filename, int linenr)
{
StreamReader f = new StreamReader(filename);
ArrayList lines = new ArrayList();
string line;
while ((line = f.ReadLine()) != null)
lines.Add(line);
return lines[linenr].ToString();
}
public static string getDateStart()
{
string theDate=GetHeaderFromFile(@"C:\Log\log.dat", 2);
return theDate;
}
As a newbee i am wondering why this does not work and if someone has some
tip that can help
me.
Best regards