728x90

c# 30

[c#] ftp에서 불러온 파일을 저장할 때, 같은 이름의 파일이 있을 경우 넘버링(숫자) 해주기

//저장할 파일이름을 이미 포함하고 있다면 넘버링 foreach (FileInfo File in di.GetFiles()) { String FullFileName = File.FullName; if (FullFileName.Contains(logName + "(" + fileCount + ")")) { fileCount++; } } saveFileDialog.InitialDirectory = filePath; saveFileDialog.Title = "저장 경로를 지정하세요."; saveFileDialog.FileName = logName + "(" + fileCount + ")"; fileCount = 0; FileInfo File in di.GetFiles() foreach문으로 현재 디렉토리의 모든..

c# 2023.03.29

[c#] FTP에서 매개변수 "logName"을 파일 명으로 가진 파일을 다운로드하는 창 띄우기

public void OpenLogDownloadWindow(string logName) { try { //TODO 최희연 : FTP에서 매개변수 logName을 파일 명으로 가진 파일을 다운로드 창을 띄움 string fileName = string.Empty; //ftp에서 디렉토리 목록 전체 조회한 데이터 string[] filesInDirectory = LoadFTPData( newUrl + logName, id, pwd, download); string data1 = string.Empty; for (int i = 0; i < filesInDirectory.Length; i++) { data1 += filesInDirectory[i]; } SaveFileDialog saveFileDialog =..

c# 2023.03.27

[c#] FTP에서 디렉토리(Directory)와 파일(File) 불러오기

💡 디렉토리와 파일을 구분하는 방법? 불러온 주소를 다시 덧붙여서 하위 디렉토리가 있는지 검사 → 하위 파일이나 디렉토리가 없는 경우, 검사하기 어려움 파일 접근 권한에 ‘d’가 붙은 지 검사 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace loadingFtp { internal class Class1 { public static void Main(String[] args) { Uri ftpUri = ..

c# 2023.03.21

[백준 15650번 c#] N과 M(2)

- 앞서 풀었던 N과 M의 응용버전입니다. - 해당 문제에에서는 1,2 와 2,1 을 중복으로 보고 출력하지 않습니다. - 이 뜻은 visit 을 자기 자신보다 앞 인덱스인 것을 모두 false로 돌리면 된다는 뜻입니다. using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Project2 { class Class1 { static StringBuilder sb = new StringBuilder(); static int[] arr; static bool[] ..

카테고리 없음 2022.10.06

[백준 15649번 c#] N과 M

- 브루트포스: 모든 경우의 수 - 백트래킹: 해당 노드의 유망성을 판단 - DFS(깊이우선탐색): 트리순회의 한 형태, 백트래킹에 사용하는 대표적인 탐색 알고리즘 백트래킹 = DFS가 아니라 백트래킹의 방법 중 하나가 DFS BFS(너비우선탐색) 등 다양한 방법으로 백트래킹을 구현가능 using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Project2 { class Class1 { static StringBuilder sb = new StringBuilde..

728x90