123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- 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
- {
- }
- }
- }
- }
|