C#4 C# .xml 파일 실행파일 경로 가져오는법 string currentDir = ProcessExecutor.GetCurrentExePath();string xmlFile = System.IO.Path.Combine(currentDir, "SettingFile.xml");XmlDocument doc = new XmlDocument();doc.Load(xmlFile);// Application 노드 찾기XmlNode appNode = doc.SelectSingleNode("//Application");// Setting 노드에서 필요한 값 추출string programPath = appNode.SelectSingleNode("Setting").InnerText;string fullProgramPath = System.IO.Path.Combine(cu.. 2024. 7. 31. C# 로그 클래스 using System;using System.IO;public class LoggerTest{ private readonly string logFilePath; public LoggerTest() { // 현재 실행 중인 애플리케이션의 경로를 기준으로 Log 폴더 경로 설정 string logDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log"); // Log 폴더가 없으면 생성 if (!Directory.Exists(logDirectory)) { Directory.CreateDirectory(logDirectory); }.. 2024. 7. 23. C# ATM 기능 만들기 public class BankAccount{ public string AccountNumber { get; set; } public string OwnerName { get; set; } public string Password { get; set; } public decimal Balance { get; set; }}public class ATM{ private List accounts; public ATM() { accounts = new List(); } public void CreateAccount(string accountNumber, string ownerName, string password) { BankAcco.. 2024. 6. 28. 유니티 C# 객체 끼리 충돌 할때 뭔가를 하고 싶을때 ??? 필요한 함수 using System.Collections; using System.Collections.Generic; using UnityEngine; public class player : MonoBehaviour { Rigidbody rigid; public float Jump_Power; bool isJump; void Awake() { rigid = GetComponent(); } void Update() { if (Input.GetButtonDown("Jump") && !isJump) { isJump = true; rigid.AddForce(new Vector3(0, Jump_Power, 0), ForceMode.Impulse); } } // Update is called once per frame voi.. 2022. 1. 6. 이전 1 다음