public static void DownloadFile(string fromUrl,string toUrl,string saveName)
{
    WebClient Client=new WebClient();
Stream strm=Client.OpenRead(fromUrl);
StreamReader sr=new StreamReader(strm);
FileStream fs=new FileStream(toUrl+saveName,FileMode.CreateNew,FileAccess.Write,FileShare.None);
StreamWriter sw=new StreamWriter(fs);
Directory.CreateDirectory(toUrl+"\\"+saveName.TrimEnd('.','h','t','m')+@".files");
string line;
do
{
line=sr.ReadLine();
if(line==null)
break;
MatchCollection Matchs=Regex.Matches(line,@"\b(http://)(\S*)(.gif)\b",RegexOptions.IgnoreCase);
foreach (Match nextMatch in Matchs)
{
string DownloadUrl=nextMatch.Value;
Console.WriteLine(DownloadUrl);
string[] sna=DownloadUrl.Split('/');
Client.DownloadFile(DownloadUrl,toUrl+"\\"+saveName.TrimEnd('.','h','t','m')+".files"+"\\"+sna[sna.Length-1]);
line.Replace(DownloadUrl,saveName.TrimEnd('.','h','t','m')+".files"+"\\"+sna[sna.Length-1]);
}
sw.WriteLine(line);
}
while(line!=null); strm.Close();
}