基本上,我有一个DataGridView和一个包含dataGridView数据的XML文件。基本上,我已经找到了这个代码:
public static string DownloadString(string address)
{
string text;
using (var client = new WebClient())
{
text = client.DownloadString(address);
}
return text;
}
private static void Main(string[] args)
{
var xml = DownloadString(@"http://www.ploscompbiol.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pcbi.1002244&representation=XML");
File.WriteAllText("C:\Moderator\Desktop\blah.xml", xml);
}
但是,我需要知道如何在加载后立即下载网站。此外,我需要在将此文件下载到dataGridView后立即加载。这怎么可能?