전체 글 썸네일형 리스트형 폴더 생성하기 path 변수에 경로 넣어주면 된다. 해당 경로 중 없는 폴더는 모두 생성한다. DirectoryInfo dir = new DirectoryInfo(path); if (!dir.Exists) { dir.Create(); } 더보기 C# 홀수, 짝수 여부 판단하기 1. 짝수여부 판단하기 public bool IsEvenNumber(byte myNumeric) { return myNumeric % 2 == 0; } public bool IsEvenNumber(short myNumeric) { return myNumeric % 2 == 0; } public bool IsEvenNumber(int myNumeric) { return myNumeric % 2 == 0; } public bool IsEvenNumber(long myNumeric) { return myNumeric % 2 == 0; } 2. 홀수여부 판단하기 public bool IsOddNumber(byte myNumeric) { return myNumeric % 2 == 1; } public bool I.. 더보기 C# 진수 변환 1. 2진수 -> 10진수 public int BinaryToDecimal(string myString) { return Convert.ToInt32(myString, 2); } 2. 8진수 -> 10진수 public int OctalToDecimal(string myString) { return Convert.ToInt32(myString, 8); } 3. 16진수 -> 10진수 public int HexaToDecimal(string myString) { return Convert.ToInt32(myString, 16); } 4. 10진수 -> 2진수 public string DecimalToBinary(int myNumeric) { return Convert.ToString(myNumeric, 2).. 더보기 이전 1 2 3 4 ··· 8 다음