일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- IValueConverter
- Microsoft
- tls
- algorithm
- log
- logging
- coding-test
- git
- ListView
- Github
- programmers
- chashtag
- Coding
- convert
- commit
- Visual Studio
- File
- string
- windows
- Process
- dotNET
- nullable
- 코딩테스트
- .net
- Binding
- mysql
- C#
- csharp
- windows10
- WPF
- Today
- Total
목록C# (73)
CHashtag

안녕하세요. 오늘은 DateTime과 TimeStamp간의 변환 방법에 대해 알아보도록 하겠습니다. 간단하니 바로 코드로 보여드리도록 하겠습니다. public long GetCurrentTimeStamp() { DateTime dt = DateTime.Now; return ((DateTimeOffset)dt).ToUnixTimeSeconds(); } public long DateTimeToTimeStamp(DateTime value) { return ((DateTimeOffset)value).ToUnixTimeSeconds(); } public DateTime TimeStampToDateTime(long value) { DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0,..

.net framework는 사용자에게 여러 기능을 제공합니다. 예를 들자면 Int32, String, System 등과 같은 것들을요. 개발을 하다보면 .net framework에서 제공하는 함수나 속성의 정의 부분으로 가면 전체 코드가 아닌 Summary만 보이는 것을 확인하실 수 있습니다. 이는 컴파일된 dll를 참조하는 것이기 때문에 전체 코드를 볼 수 없고 해당 함수나 속성의 정의와 설명 정도만 보이는 것입니다. 그런데 .net framework에서 제공하는 기능은 실제로 어떻게 구현되어 있는지 안다면 더 효율적으로 개발할 수 있을 것입니다. 그래서 오늘은 .net framework 내부 코드 보는 법에 대해 알아보도록 하겠습니다. .net framwork 코드 보는 법 제가 오늘 추천해드릴 사..
안녕하세요. 오늘은 프로젝트의 어셈블리 버전 가져오는 법과 버전과 버전을 비교하는 방법에 대해 알아보도록 하겠습니다. 저는 처음에 숫자와 점(.)으로 분리된 버전을 어떻게 비교하여야 하나 잠깐 고민했었는데요, 다행히도 C#에서 버전 간의 비교 기능을 제공하여 해당 기능을 사용하여 버전을 비교해 보도록 하겠습니다 현재 어셈블리(Assembly) 버전 정보 얻기 // using System.Reflection; public void Main() { AssemblyName assemblyName = Assembly.GetExecutingAssembly().GetName(); Version assemblyVersion = assemblyName.Version; } 어셈블리(Assembly) 버전 비교하기 어셈블..

결론부터 알려드리겠습니다. public class MainViewModel { private string _filter = string.Empty; public string Filter { get => _filter; set { _filter = value; OnFilterChanged(); } } private ObservableCollection StringFilter { get; set; } private CollectionViewSource StringCollectionViewSource { get; set; } public ICollectionView StringCollection { get { return StringCollectionViewSource.View; } } public MainV..

public bool CheckFileLocked(string filePath) { try { FileInfo file = new FileInfo(filePath); using (FileStream stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None)) { stream.Close(); } } catch (IOException) { return true; } return false; } 감사합니다.

오늘은 폴더를 zip 파일로, zip 파일을 폴더로 만드는 방법에 대해 알아보겠습니다. 아래 코드를 구현하기 위해선 System.IO.Compression.FileSystem을 Reference에 추가하여야 합니다. static void Main(string[] args) { string directoryPath = @"D:\Record"; string zipPath = @"D:\Record.zip"; string unzipPath = @"D:\UnzipRecord"; bool zipResult = ZipDirectory(directoryPath, zipPath); bool unzipResult = UnzipFile(zipPath, unzipPath); } public static bool ZipDire..

using System.Collections.Generic; using System.IO; using System.Text; namespace CHashtag { class FileIO { static void Main(string[] args) { string inputFilePath = @"c:\temp\input.txt"; string outputFilePath = @"c:\temp\output.txt"; var inputArr = File.ReadAllLines(inputFilePath, Encoding.UTF8); // change array to list var inputList = new List(inputArr); List outputList = new List(); inputList.Fo..

결론부터 알려드리겠습니다. public void MyMethod() { Console.WriteLine(MethodBase.GetCurrentMethod().Name); // output : MyMethod } GetCurrentMethod라는 함수를 사용하면 MethodBase 객체를 얻을 수 있습니다. MethodBase객체에는 다음과 같은 값이 있습니다. 해당 속성은 주로 Logging을 할 때 사용됩니다. 감사합니다.

안녕하세요. 오늘은 csv 파일을 파싱 하는 방법에 대해 알아보겠습니다. CSV 파일이란? csv 파일 확장자는 comma-separated values라는 의미로 " , " 로 구분하는 텍스트 파일 확장자입니다. 엑셀을 이용하여 데이터를 csv파일로 저장한 뒤 데이터를 파싱 하여 보겠습니다. 해당 파일을 메모장으로 열어보면 다음과 같은 데이터가 보입니다. 번호,이름,사는곳,직업 1,Henry,대구,개발자 2,Tom,서울,선생님 3,Jonathan,대전,경찰 4,James,부산,무직 5,Rachel,인천,의사 6,Samuel,창원,학생 7,Peter,안동,농부 8,Clara,울진,선장 9,Harry,울산,역무원 이제 이 데이터를 파싱해 보도록 하겠습니다. 프로그램 제작 csv를 파싱하는 수많은 라이브러리..

APP을 생성했다면 이젠 SDK를 다운로드 받고, 사용하는 방법에 대해 알아보겠습니다. SDK 소개 우선 간단히 SDK에 대해 소개해드리겠습니다. marketplace.zoom.us/docs/sdk/native-sdks/windows/c-sharp-wrapper C# wrapper - Windows - Client SDKs - Zoom Software Development Kit (Zoom SDK) C# Wrapper Contents 1\. C# wrapper Even though our Windows SDK demo and native interfaces are written in C/C++, we are still thinking about benef... marketplace.zoom.us Zoom..