728x90
반응형
728x170
▶ Program.cs
using System;
using System.Configuration;
namespace TestProject
{
/// <summary>
/// 프로그램
/// </summary>
class Program
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Static
//////////////////////////////////////////////////////////////////////////////// Private
#region 프로그램 실행하기 - Main()
/// <summary>
/// 프로그램 실행하기
/// </summary>
private static void Main()
{
Configuration configuration = ConfigurationManager.OpenMappedExeConfiguration
(
new ExeConfigurationFileMap { ExeConfigFilename = "AppAnother.config" },
ConfigurationUserLevel.None
);
foreach(KeyValueConfigurationElement element in configuration.AppSettings.Settings)
{
string value = ConfigurationManager.AppSettings[element.Key];
if(value == null)
{
ConfigurationManager.AppSettings.Set(element.Key, element.Value);
}
else
{
ConfigurationManager.AppSettings[element.Key] = element.Value;
}
}
Console.WriteLine("Language : {0}", ConfigurationManager.AppSettings["Language"]);
Console.WriteLine("Version : {0}", ConfigurationManager.AppSettings["Version" ]);
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
'C# > Common' 카테고리의 다른 글
[C#/COMMON] DirectoryInfo 클래스 : EnumerateDirectories 메소드를 사용해 디렉토리 크기 구하기 (0) | 2018.09.13 |
---|---|
[C#/COMMON] DirectoryInfo 클래스 : EnumerateFiles 메소드를 사용해 디렉토리 크기 구하기 (0) | 2018.09.13 |
[C#/COMMON] FSO를 사용해 디렉토리 크기 구하기 (0) | 2018.09.13 |
[C#/COMMON] 우리나라 전통 색상 코드 (0) | 2018.09.08 |
[C#/COMMON] Convert 클래스 : ChangeType 정적 메소드를 사용해 지정 타입으로 변환하기 (0) | 2018.09.03 |
[C#/COMMON] 애플리케이션 구성 파일 변경하기 (0) | 2018.08.22 |
[C#/COMMON] FTP 클라이언트 프로그램 만들기 (0) | 2018.08.21 |
[C#/COMMON] 부모 프로세스에서 자식 프로세스 표준 출력 수신하기 (0) | 2018.08.20 |
[C#/COMMON] PING 사용하기 (0) | 2018.06.11 |
[C#/COMMON] IP 주소 추출하기 (0) | 2018.06.11 |
댓글을 달아 주세요