dannyvk100
Gebruiker
- Lid geworden
- 7 feb 2012
- Berichten
- 19
Dit is mijn code:
public static string SearchFile(string keyword)
{
int counter = 0;
string line;
string NoContent = "Geen gegevens gevonden";
List<string> list = new List<string>();
System.IO.StreamReader
file = new System.IO.StreamReader("c:\\Users/danny/Documents/Visual Studio 2008/Projects/Log Solution/test files/test.txt");
while ((line = file.ReadLine()) != null)
{
if (line.Contains(keyword))
{
list.Add(counter.ToString() + ": " + line);
}
counter++;
}
return list;
}
Hoe kan ik mijn list returnen?
Alvast bedankt
public static string SearchFile(string keyword)
{
int counter = 0;
string line;
string NoContent = "Geen gegevens gevonden";
List<string> list = new List<string>();
System.IO.StreamReader
file = new System.IO.StreamReader("c:\\Users/danny/Documents/Visual Studio 2008/Projects/Log Solution/test files/test.txt");
while ((line = file.ReadLine()) != null)
{
if (line.Contains(keyword))
{
list.Add(counter.ToString() + ": " + line);
}
counter++;
}
return list;
}
Hoe kan ik mijn list returnen?
Alvast bedankt