I have the following problem. I've created a variable and when I use it in code it gives me an error: Severity Code Description Project File Line Suppression State Error CS0120 An object reference is required for the non-static field, method, or property 'Form1.assemblyPath' Form Change Wallpaper
My code
public partial claass Form1: Form
{
private string assemblyPath = Path.GetFullPath(Assembly.GetExecutingAssembly().Location);
private static string[] GetAllWallpapers(string daytime)
{
string dataPath = assemblyPath + @"..\..\..\..\data"; // Error line
}
}
The rest of the code has no problem