1. 1. 함수
<code />
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. 2. 사용방법
<code />
// 데이터저장
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++);
'프로그래밍 > C#' 카테고리의 다른 글
[C#] Selenium WebDriver 자바스크립트 실행하기! (0) | 2019.01.05 |
---|---|
[C#] Selenium WebDriver 느리게 입력 ( 타이핑 효과 주기) (1) | 2019.01.05 |
[C#] 파일입력( StreamReader)하는 함수 (0) | 2018.12.25 |
[C#] 프로세스(Process) 종료 하는 메소드 (0) | 2018.12.25 |
[C#] Selenium ChromeDriver Option 옵션 정리 ( Proxy 변경법 포함) (0) | 2018.12.25 |