1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- using System.IO;
- using System.Reflection;
- using LJLib.Tools.File;
- namespace LJLib.InstallHelper
- {
- static class LJInstallGlobal
- {
- private const string section = "E0A0E72ECA4D4BEC950A4A3B1E75DC0F";
- public static string CurrentPath
- {
- get
- {
- return Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase).Replace("file:\\", "");
- }
- }
- public static string FileName
- {
- get
- {
- return Path.GetFileName(Assembly.GetExecutingAssembly().GetName().CodeBase);
- }
- }
- public static string XmlFile
- {
- get
- {
- return FileName + ".xml";
- }
- }
- public static void SetValue(string key, string value)
- {
- string xmlfile = CurrentPath + "\\" + XmlFile;
- XmlConfig xmlconfig = new XmlConfig();
- xmlconfig.SetXmlFileValue(xmlfile, section, key, value);
- }
- public static string GetValue(string key)
- {
- string xmlfile = CurrentPath + "\\" + XmlFile;
- XmlConfig xmlconfig = new XmlConfig();
- return xmlconfig.GetXmlFileValue(xmlfile, section, key, string.Empty);
- }
- public static string ServerName
- {
- get
- {
- return GetValue("ServerName");
- }
- set
- {
- SetValue("ServerName", value);
- }
- }
- public static string DisplayName
- {
- get
- {
- return GetValue("DisplayName");
- }
- set
- {
- SetValue("DisplayName", value);
- }
- }
- public static string Description
- {
- get
- {
- return GetValue("Description");
- }
- set
- {
- SetValue("Description", value);
- }
- }
- public static string ImagePath
- {
- get
- {
- return GetValue("ImagePath");
- }
- set
- {
- SetValue("ImagePath", value);
- }
- }
- }
- }
|