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

namespace IControls_FireManager
{
    public static class _Cfg
    {
        // 파일 생성
        // Path는 "C:\\Documents and Settings\\gadget81\\My Documents\\Visual Studio 2010\\Projects\\INI\\test.cfg"
        public static bool Create_Cfg(string txt, string path)
        {
            try
            {
                // 파일이 존재하면 삭제
                if (File.Exists(path))
                {
                    File.Delete(path);
                }

                // 파일 생성
                File.WriteAllText(path, txt);

                // 성공
                return true;
            }
            catch (Exception e)
            {
                // LOG                
                _Event.DebugView_SendMessage_Write(e.ToString());

                // 실패
                return false;
            }
        }

        // 파일 삭제
        // Path는 "C:\\Documents and Settings\\gadget81\\My Documents\\Visual Studio 2010\\Projects\\INI\\test.cfg"
        public static void Write_Ini(string path)
        {
            try
            {
                // 파일이 존재하면 삭제
                if (File.Exists(path))
                {
                    File.Delete(path);
                }
            }
            catch
            {

            }
        }
    }
}