當我運行windows窗體應用程序時,它顯示initializer cannot reference the nonstatic field method or property
。字段初始值設定項不能引用c中的非靜態字段方法或屬性錯誤#
string lia = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
StreamReader fileitem=new StreamReader(Path.Combine(lia,"dataset.txt")); //Error line
我瘦,它無法識別lia
爲字符串。 有什麼想法?
你確定這兩條線是緊跟在一起嗎? – nvoigt