Text problem
From: Trond (thoiberg_at_broadpark.no)
Date: 11/03/04
- Next message: mg: "Process.Start syntax"
- Previous message: John: "RE: Visual C# .NET Standard + ASP.NET + Integrated Source Control?"
- Next in thread: Justin Rogers: "Re: Text problem"
- Reply: Justin Rogers: "Re: Text problem"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Nov 2004 22:16:04 +0100
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
- Next message: mg: "Process.Start syntax"
- Previous message: John: "RE: Visual C# .NET Standard + ASP.NET + Integrated Source Control?"
- Next in thread: Justin Rogers: "Re: Text problem"
- Reply: Justin Rogers: "Re: Text problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|