Vreau sa fac un auto-updater, dar am problema asta: "An Object reference is required for the non-static field", si daca in pun non-static am aceasi problema dar altundeva:
code:
public static void Updateing()
{
WebClient client = new WebClient();
client.DownloadProgressChanged += Client_DownloadProgressChanged; //a doua eroare daca il fac non-static
client.DownloadFileCompleted += Client_DownloadFileCompleted;
FileLink"), "fileName");
}
private static void Client_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
MessageBox.Show("Download Complete");
}
private static void Client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
UpdateProgress.Maximum = e.TotalBytesToReceive; //Prima eroare!
}