[c#] 디렉터리 하위까지 검사해서 특정 확장자를 가진 파일만 삭제하기
·
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#] 11659번 구간 합 구하기 4
·
c#/백준알고리즘
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#] 274333번 팩토리얼 2
·
c#/백준알고리즘
https://www.acmicpc.net/problem/27433 27433번: 팩토리얼 2 0보다 크거나 같은 정수 N이 주어진다. 이때, N!을 출력하는 프로그램을 작성하시오. 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) { long n= long.Parse(Console.ReadLine()); Console.WriteLine(Facto(n)); } public ..
[c#] Dictionary 의 value 값이 Dictionary 일 경우 데이터 추가하기
·
c#
Dictionary 의 value 값이 Dictionary 일 경우 선언하기 Dictionary MMSDataDic; Dictionary 에 데이터 추가하기 MMSDataDic.Add(values[i],new Dictionary()); MMSDataDic[values[i]].Add(streamName, dateTime); - value 값에 곧바로 값을 넣지 않고, new Dictionary() 를 넣어준다. - 해당 key에 알맞은 value 값을 Add 로 넣어준다.
[c#] tiff 파일을 jpg로 변환하는 프로그램
·
c#
- 우선 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..
[WPF] ComboBox 사용해보기
·
c#/WPF
1. 도구상자에서 ComboBox 끌어다 놓기 2.ComboBox Items 추가하기 3. xmlns 태그 추가 4. Event 추가
[WPF] MSSQL/MYSQL 데이터베이스 이용하기
·
c#/WPF
https://www.microsoft.com/ko-kr/download/details.aspx?id=35579 1. 데이터베이스 생성 및 테이블 생성 2. 데이터 삽입 및 조회 3. xaml.cs 파일에 조회 및 삽입 버튼 생성 ( 삽입의 경우를 위해 TextBox 3개도 생성) 4. MainViewModel 클래스에 ICommand SelectClick(조회), InsertClick(삽입) 생성 5. USERINFO List를 생성 6. USERINFO에 넣을 Name, Img, Age 프로퍼티 생성 7. 데이터베이스 조회 메서드 생성: async Task 로 생성 - query: - exception 처리 8. 데이터베이스 데이터 삽입 메서드 생성: async Task 로 생성 - query: - ..
[WPF] 새로운 창 띄우기 (버튼 클릭 시)
·
c#/WPF
1. Views폴더에 SecondView.xaml 생성 2. SecondViewModel 생성 및 ProgressValue 정의 3. SecondView.xaml 의 progressBar에 Value에 Binding 4. MainViewModel에 SecondShow 생성 (ICommand) 5.MainWindow.xaml 에 버튼 생성 및 command binding
[WPF] UserControl / CustomControl
·
c#/WPF
1. 새로운 WPF 창을 솔루션 UserControls 폴더에 생성 2. MainWindow로 가서 도구상자에 새로운 WPF 창이 생성된 것을 확인 3. ThreeControls 코드에 의존 속성 등록 4. ThreeControls XAML 이름 지정 5. MainWindow 에서 Label MyText 값 지정 6. ThreeControls(usercontrol) 에 Button 추가 7. ThreeControls 코드에 의존속성 추가 : ICommand 리턴, 기본값은 지워주기 8. MainWindow에 MyCommand 값 추가 1.새로운 WPF창을 MyLabel 이라는 이름으로 생성 2. 태그를 Label 로 변경 3. BackGround Color=Black / ForeGround Color=W..
[WPF] Task, 비동기, AsyncRelayCommand
·
c#/WPF
Task: 쓰레드풀로부터 쓰레드를 가져와 비동기 작업을 실행 - task2.Wait() : 작업이 끝날 때까지 대기 AsyncRelayCommand - await 키워드: 비동기 작업이 끝난 후에 UI를 업데이트 해야하는 경우 사용, 작업이 끝나기 전에도 UI를 사용할 수 있음 - async relay 함수: 비동기 함수 지원, 매끄러운 UI 업데이트 사용 가능