c#
-
[CSV 파싱 1] 텍스트파일 한글 깨짐android 2018. 7. 3. 16:28
CSV 파일을 읽어 리스트에 담았다가 다시 CSV 파일로 저장한다. 이 과정에서 한글이 깨지는 현상이 있어 다음과 같이 해결. System.Text.Encoding.Default 잘 작동한다. 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 public void readCsvFile(String path) { StreamReader sr; sr = new StreamReader(path, System.Text.Encoding.Default); while (!sr.EndOfStream) { string s = sr.ReadLine(); //... } sr.Close(); } public void writeCsvFile(string pat..
-
First or Default 값 가져오기android 2017. 9. 19. 16:09
12345678910111213141516 List doubleList = new List(); double a = doubleList.FirstOrDefault(); //a => 0 List stringList = new List(); string b = stringList.FirstOrDefault(); //b => null List boolList = new List(); bool c = boolList.FirstOrDefault(); //c => false List regexList = new List(); Regex d = regexList.FirstOrDefault(); //d => null List intList = new List(); int e = intList.FirstOrDefault..
-
포인트 정렬2카테고리 없음 2015. 12. 10. 22:37
Imports System.Drawing Imports System.Collections.Generic Module Module1 Public Structure Man Dim Name As String Dim Age As Integer End Structure Sub Main() Dim dict As New Dictionary(Of PointF, Man) For i As Integer = 0 To 2 Dim pt As PointF = New PointF(i * 2, i * 3) Dim aMan As Man = New Man() aMan.Name = "Sam " + i.ToString aMan.Age = (i + 1) * 10 dict.Add(pt, aMan) Next Dim sortDict = (From..
-
AutoCAD .NET Developer's Guidecoding/AutoCAD .NET 2015. 12. 9. 21:05
AutoCAD .NET Developer's Guide