우아한 프로그래밍

1. 함수


        static void LineChanger(string newText, string fileName, int line_to_edit)
        {
            string[] arrLine = File.ReadAllLines(fileName, Encoding.Default);
            arrLine[line_to_edit - 1] = newText;
            File.WriteAllLines(fileName, arrLine, Encoding.Default);
        }

2. 사용방법


// 데이터저장
LineChanger(string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", authVO.username, authVO.password, authVO.company, authVO.url, authVO.apiKey, authVO.secretKey), "./config/auth.txt", globalIndex++);
profile

우아한 프로그래밍

@자바조아!

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!