我在实用程序类中有一个函数
namespace GUI.code
{
public class Utility
{
public string GetFileName(string grpID)
{
string filenameUNC = "\\\\" + "localhost" + "\\AgentShare\\";
string realPath = GetPath(filenameUNC);
return realPath;
}
}
}
现在我从项目中的另一个页面调用这个函数,如下所示:
new utility.GetCSFileName(ID);
为什么我需要添加新的,为什么我不能这样称呼它
GetCSFileName(ID);
当我有
using GUI.code;
在上面
如果我删除新的,我会收到此错误
错误 1 非静态字段、方法或属性 'copiunGUI.code.GUIUtility.GetCSFileName(string) 需要对象引用
有什么建议么