c#
-
LINQ-조인c# 2017. 5. 6. 11:29
내부조인 : -기준 데이터A, 비교 데이터 중, A와 B의 교집합-기준데이터 A에 존재하지만 B에 존재하지 않은 데이터는 조인된 결과에서 누락 됩니다. from a in Ajoin b in B on a.XXX equals b.YYYY 외부조인: 외부 조인은 기본데이터에 들어 있는 모든 데이터는 포함되어 있다. using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace Join{ class Program { class Profile { public string Name { get; set; } public int Height { get; set; }..
-
LINQ-Group BYc# 2017. 5. 6. 10:38
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace GroupBy{ //group A by B into C //A는 from절에서 뽑아낸 변수 B는 분류 기준 C는 그룹변수 //Igrop class Program { class Profile { public string Name { get; set; } public int Height { get; set; } } static void Main(string[] args) { Profile[] arrProfile = { new Profile() {Name="정우성",Height=180 }, ne..
-
-
File ReadAllLinesc# 2017. 4. 15. 08:12
using System; using System.IO; class Test { public static void Main() { string path = @"c:\temp\MyTest.txt"; // This text is added only once to the file. if (!File.Exists(path)) { // Create a file to write to. string[] createText = { "Hello", "And", "Welcome" }; File.WriteAllLines(path, createText); } // This text is always added, making the file longer over time // if it is not deleted. string ..
-
string에 헥사값 더하기c# 2017. 4. 15. 08:04
string lineOne = "One"; string lineTwo = "Two"; char CarriageReturn = (char)0x0D; string final = lineOne + CarriageReturn.ToString() + lineTwo + CarriageReturn.ToString(); or the easier to read method: string lineOne = "One"; string lineTwo = "Two"; string final = string.Format("{0}\r{1}\r", lineOne, lineTwo); // or lineOne + "\r" + lineTwo + "\r";
-