public static string GetHTMLLookUp(string value)
{
StreamReader sr = null;
string[] ab = new string[2];
string a;
string b;
int c = 0;
string[] lines = null;
string replace;
if (value == null)
return value;
try
{
sr = new StreamReader(System.Windows.Forms.Application.StartupPath + @"\HTML-Look-Up.txt");
while (!sr.EndOfStream)
{
ab = sr.ReadLine().Split(' ');
a = ab[0];
b = ab[1];
if (value.Contains(a) || value.Contains(b))
{
while (value.Contains(a))
{
replace = sr.ReadLine();
value = value.Replace(a, replace);
}
while (value.Contains(b))
{
replace = sr.ReadLine();
value = value.Replace(b, replace);
}
}
else
{
sr.ReadLine();
}
}
}
catch (FileNotFoundException)
{
ErrorWindow ew = new ErrorWindow();
ew.IssueGeneralWarning("HTML replacing will not occur", "Could not find HTML-Look-Up.txt...", null);
}
catch (Exception e)
{
ErrorWindow ew = new ErrorWindow();
ew.IssueGeneralWarning("Error..", lines[c], e.Message);
}
finally
{
if (sr != null)
sr.Dispose();
}
return value;
}