C#/기초
-
[C#] params 키워드C#/기초 2023. 10. 31. 10:25
params 키워드란 메소드에서 배열형태의 매개변수를 받을때 사용하는 키워드 입니다. 이 키워드를 사용하면 해당 메소드를 호출할때 반드시 배열을 넘겨줄 필요가 없어집니다. params 키워드가 모든 변수들을 모아서 배열로 만들어 주는 기능을 하기 때문입니다. 간단한 예시를 보겠습니다. 1 2 3 4 5 6 7 public void setVarList(params string[] var) { mTable.Columns.Clear(); for (int i = 0; i
-
[C#] Zip 파일 목록, XMLC#/기초 2023. 10. 20. 13:32
UnZip 하지않고 Zip 파일 열어서 파일 목록 가져오고 xml 파일 다루기 List OpenFileApp(string path) { var appPath = path; //string appPath = Directory.GetCurrentDirectory() + @"\AppPackages\Robot.app"; var appList = GetListAppFilesName(appPath); var dicAspec = new Dictionary(); var aspecList = new List(); foreach (var app in appList) { var archiveAppFile = ZipFile.OpenRead(app); Dictionary getFiles = GetFiles(archiveAppF..
-
[C#] Zip, UnZipC#/기초 2023. 10. 17. 10:48
https://chashtag.tistory.com/24 [C#] 압축, 압축 풀기 (zip, unzip) 오늘은 폴더를 zip 파일로, zip 파일을 폴더로 만드는 방법에 대해 알아보겠습니다. 아래 코드를 구현하기 위해선 System.IO.Compression.FileSystem을 Reference에 추가하여야 합니다. static void Main(string[] args) chashtag.tistory.com https://chashtag.tistory.com/90 [C#] 압축, 압축 풀기 with 비밀번호 (zip, unzip with password) 안녕하세요. 오늘은 https://chashtag.tistory.com/24 에 이어 비밀번호와 함께 압축, 압축을 푸는 방법에 대해 알아보도록..
-
[C#] Action<T>C#/기초 2023. 10. 4. 11:46
전달 인자가 T인 반환 값 Void 메소드를 담는 대리자(Delegate) https://usingsystem.tistory.com/180 [C#] Action.Invoke() vs Action() 차이 action.Invoke는 action?.Invoke와 같이 action 콜백이 null인지 검사하고 null이 아닐 때에만 Invoke 되도록 사용하고자 할 때 많이 사용한다. 기존 예외처리 if(_action !=null) _action.Invoke(3);// _action(3) 과 같은 코 usingsystem.tistory.com https://blog.joe-brothers.com/csharp-delegate-func-action/ [C#] Delegate, Func, Action 이해하기: 차..
-