You can hook methods with outside methods...
private static void WriteFile(string data)
{
string path = System.IO.Directory.GetCurrentDirectory() + "\\log.txt";
System.IO.File.WriteAllText(path,data);
}
using (var wc = new System.Net.WebClient())
{
string contents = wc.DownloadString("some-site-with-data.com/file.txt");
WriteFile(contents);
}