- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
public static string _GetValueFromConfigFile(string sKey)
{
string sReturnValue = _scNullString;
string filePath = System.IO.Directory.GetCurrentDirectory() + @"\App.config";
// FOR TDOCS
//string filePath = @"D:\hosting\4856094\html\Bin\App.config";
XmlDocument doc = new XmlDocument();
XmlNode rootNode;
XmlNode xmlNode;
try
{
doc.Load(filePath);
rootNode = doc.DocumentElement;
xmlNode = rootNode.SelectSingleNode("descendant::add[@key='" + sKey + "']");
if (xmlNode != null) sReturnValue = xmlNode.Attributes["value"].Value;
return sReturnValue;
//return "";
}
catch// (Exception Ex)
{
//_ErrorDetail = Ex.Message;
return _scNullString;
}
}