using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Common
{
    /// <summary>
    /// 配置参数
    /// </summary>
    public static class AppConfig
    {
        private static AppSettingsSection appSettings;
        private static Configuration config;
        static AppConfig()
        {
            string assemblyConfigFile = System.Reflection.Assembly.GetEntryAssembly().Location;
            config = ConfigurationManager.OpenExeConfiguration(assemblyConfigFile);
            //获取appSettings节点    
            appSettings = (AppSettingsSection)config.GetSection("appSettings");
        }

        /// <summary>
        /// 当前程序启动路径
        /// </summary>
        public static string StartupPath
        {
            get
            {
                return System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
            }
        }
        public static string ConfigFile
        {
            get
            {
                return StartupPath + "\\qt.ini";
            }
        }

    }
}
