public static string OptimazeImages(string temp)
{
int imgLoc = 0;
int srcLoc = 0;
int imgEndLoc = 0;
while (imgLoc != -1)
{
imgLoc = temp.IndexOf("<img", imgEndLoc);
imgEndLoc = temp.IndexOf(">", imgLoc + 1);
if (imgLoc == -1)
break;
srcLoc = temp.IndexOf("src=", imgLoc, imgEndLoc - imgLoc);
temp = temp.Insert(srcLoc + 5, "ThumbnailViewer.aspx?X=0&Y=0&FilePath=");
}
return temp;
}