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); }
and call it in method
using (var wc = new System.Net.WebClient()) { string contents = wc.DownloadString("some-site-with-data.com/file.txt"); WriteFile(contents); }
Last updated 3 years ago
Was this helpful?