728x90

c# 30

[c#] 디렉터리 하위까지 검사해서 특정 확장자를 가진 파일만 삭제하기

using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace JsonFilesDelete { internal class FileName { static void Main(string[] args) { try { string rootPath = @"G:\fireProject_240105\화재 발생 예측 영상\Training\[라벨]화재씬\"; //json을 읽어올 경로 string[] files = Directory.GetFiles(rootPath, "*.json", SearchOption.AllDirectorie..

c# 2024.01.08

[c#] 11659번 구간 합 구하기 4

https://www.acmicpc.net/problem/11659 11659번: 구간 합 구하기 4 첫째 줄에 수의 개수 N과 합을 구해야 하는 횟수 M이 주어진다. 둘째 줄에는 N개의 수가 주어진다. 수는 1,000보다 작거나 같은 자연수이다. 셋째 줄부터 M개의 줄에는 합을 구해야 하는 구간 i와 j www.acmicpc.net using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace baekjoon27433 { internal class FileName { static void Main(string[] args) { StringBu..

[c#] tiff 파일을 jpg로 변환하는 프로그램

- 우선 visual studio 상단 메뉴바에서 '도구' -> 'NuGet 패키지 관리자' -> '패키지 관리자 콘솔' 을 클릭해줍니다. - 콘솔창에 'Install-Package Aspose.Imaging' 해줍니다. - 다음과 같은 코드를 작성합니다. using Aspose.Imaging; using Aspose.Imaging.Exif; using Aspose.Imaging.Exif.Enums; using Aspose.Imaging.FileFormats.Bmp; using Aspose.Imaging.FileFormats.Dicom; using Aspose.Imaging.FileFormats.Djvu; using Aspose.Imaging.FileFormats.Emf; using Aspose.Imag..

c# 2023.08.01

[WPF] MVVM 패턴 적용해보기 (기초, 초급, 쉬움)

ViewModels 폴더 생성 -> MainViewModel.cs 생성하기 - INotifyPropertychanged 를 상속받아야 함 : 값이 변경되면 전달하기 위해 - progressValue 값이 변한 것을 View에 나타낼것임 - INotifyPropertychanged 인터페이스 구현해주기 public event PropertyChangedEventHandler PropertyChanged; // This method is called by the Set accessor of each property. // The CallerMemberName attribute that is applied to the optional propertyName // parameter causes the prope..

c#/WPF 2023.04.12

[c#] 문자열이 숫자인지 확인 & 문자열 자르기

Task: Key가 숫자로 구성되어있다면: Key 비교할 때, 뒤에서부터 9자리까지만 비교해서 똑같으면 출력 디바이스의 Key가 숫자로만 구성되어있지 않다면, 키 전체를 비교해서 똑같으면 출력 1. 문자열이 숫자인지 확인 if (logFileNameArr[1].All(char.IsDigit)) //인덱스 [1]인 부분이 숫자로만 구성되어있다면, 뒷 9자리만 불러서 키 값과 일치하는지 검사 { string logFileNameString = logFileNameArr[1]; string tempString = logFileNameString.Substring(logFileNameString.Length-9); if (key.Equals(tempString)) { Console.WriteLine("숫자로만 ..

c# 2023.04.06
728x90