private Hashtable GetHashtableFromFile(string file)
{
Hashtable ht = new Hashtable();
string line = string.Empty;
using (StreamReader reader = new StreamReader(file))
{
int i = 0;
while ((line = reader.ReadLine()) != null)
{
i++;
string[] args = line.Split(new char[] { ' ' });
if (args.Length != 2)
{
Console.WriteLine("Invalid input string: " + i.ToString());
continue;
}
ht.Add(args[0], args[1]);
Console.WriteLine("IP:{0}, Site:{1}", args[0], args[1]);
}
}
return ht;
}
Tuesday, March 16, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment