파일에서 콘솔 입력을 전달합니다.텍스트 파일의 인수를 콘솔 앱에 전달 하시겠습니까?
여기 콘솔을 사용하여 두 개의 파일 경로를 전달하지만 사용자가 콘솔 앱을 열고 싶지는 않습니다. 경로를 설정할 수있는 구성 파일이 필요하지 않고 경로를 붙여 넣습니다. 아래에 입력하십시오.
어떻게 텍스트 파일의 인수를 전달하고 콘솔 앱을 실행할 수 있습니까?
Console.Write("Enter Error File Path: ");
string errorfilepath = Console.ReadLine();
string[] ErrorFile = System.IO.File.ReadAllLines(errorfilepath);
Console.Write("Enter Archive File Path: ");
string archivefilepath = Console.ReadLine();
string[] ArchiveFile = System.IO.File.ReadAllLines(archivefilepath);
Furthur processing which is working fine..
질문을 올바르게 이해하고 잘못된 경우 수정하십시오. 지금 콘솔에서 파일 경로를 묻는 중 중복 된 내용을 읽는 중입니다. config.txt 또는 뭔가 같은 파일 이름 – Zhanger
또는 입력을 텍스트 파일에 저장하고 응용 프로그램 실행 파일에 전달하십시오 :'yourApplication.exe
fardjad