该类中的一个函数为什么在调用时找不到函数名
using System;using System.Collections.Generic;
using System.Text;
using System.Xml;
using
namespace zlsmis
{
class ConfigManager
{
public static void SetValue(string AppKey, string AppValue)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(System.Windows.Forms.Application.ExecutablePath + ".config");
XmlNode xNode;
XmlElement xElem1;
XmlElement xElem2;
xNode = xDoc.SelectSingleNode("//appSettings");
xElem1 = (XmlElement)xNode.SelectSingleNode("//add[@key='" + AppKey + "']");
if (xElem1 != null) xElem1.SetAttribute("value", AppValue);
else
{
xElem2 = xDoc.CreateElement("add");
xElem2.SetAttribute("key", AppKey);
xElem2.SetAttribute("value", AppValue);
xNode.AppendChild(xElem2);
}
xDoc.Save(System.Windows.Forms.Application.ExecutablePath + ".config");
}
public static string GetValue(string AppKey)
{
try
{
string AppKeyValue;
AppKeyValue = System.Configuration.ConfigurationManager.AppSettings.Get(AppKey);
return AppKeyValue;
}
catch (Exception ex)
{
throw ex;
}
}
public string ConfigGetValue(string strExecutablePath, string appKey)
{
XmlDocument xDoc = new XmlDocument();
try
{
xDoc.Load(strExecutablePath + ".config");
XmlNode xNode;
XmlElement xElem;
xNode = xDoc.SelectSingleNode("//appSettings");
xElem = (XmlElement)xNode.SelectSingleNode("//add[@key='" + appKey + "']");
if (xElem != null)
return xElem.GetAttribute("value");
else
return "";
}
catch (Exception)
{
return "";
}
}
}
}
我在其它表单中调用这个类里的函数,其他的函数都行,只是ConfigGetValue这个函数找不到。
调用时的代码:ConfigManager. 后面没有该函数,为什么?