반응형 Programming/C#7 Delete All Files C# Examples (csharp-examples.net) Delete All Files (*.*) //Delete all files using System.IO; string[] filePaths = Directory.GetFiles(@"c:\MyDir\"); foreach (string filePath in filePaths) File.Delete(filePath); //Delete all files (one-row example) Array.ForEach(Directory.GetFiles(@"c:\MyDir\"), delegate(string path) { File.Delete(path); }); 2021. 6. 14. OOP 설계의 기본 원칙 SOLID Single Responsibility Principle 단일 책임 원칙 Aclass should only have one reason to change Separation of concerns - different classes handling different, independent tasks/problems. Open/Closed Principle 개방/폐쇄 원칙 Classes should be open for extension but closed for modification Liskov Substition Principle 리스코프 치환원칙 You should be able to substitute a base type for a subtype Interface Segregation Princi.. 2019. 9. 15. 테스트 자동화 Benefits of automated Testing Test your code frequently, in less time Catch bugs before deploying Deploy with confidence Refactor with confidence Focus more on the quality Refactoring means chaging the structure of the code without changing its behavior. Types of tests Unit Test : Tests a unit of an application without its external dependencies. Cheap to write , Execute fast, Don't give a lot of.. 2019. 9. 13. 닷넷에서 오라클에 접근하는 7가지 방법 http://www.simpleisbest.net/archive/2005/08/15/203.aspx 펌 이 글은 오래된 전에 작성된 글입니다. 따라서 최신 버전의 기술에 알맞지 않거나 오류를 유발할 수 있습니다. 저자는 이 글에 대한 질문을 받지 않을 것입니다. 하지만 이 글이 리뉴얼 되면 이 글에 대한 질문을 하거나 토론을 할 수도 있습니다.현재 우리나라에서 가장 많이 사용되는 데이터베이스를 꼽으라면 오라클, MS SQL Server, DB2 정도를 꼽을 수 있을 겁니다. 닷넷 플랫폼에서 데이터베이스 사용 역시 오라클 혹은 MS SQL Server 가 가장 많이 사용되는 데이터베이스일 겁니다. 그래서 닷넷에서 오라클 데이터베이스에 연결하는 방법에 대해서 씨리즈를 작성해 보려고 합니다. 귀차니즘으로 인해.. 2017. 12. 8. 세션의 SET 옵션 확인하기 세션의 SET 옵션 확인하기 세션의 현재 SET 옵션에 대한 정보를 확인하려면 @@OPTIONS함수를 사용합니다. 제 PC에서 확인해보니 5496이라는 값이 나오는군요. 근데 5496이면 어떤 옵션이 설정되어 있을까요? MSDN에서는 NOCOUNT 옵션이 설정되어 있는지 확인하기 위해 다음과 같은 방법을 사용합니다. 123SET NOCOUNT ONIF @@OPTIONS & 512 > 0 RAISERROR ('Current user has SET NOCOUNT turned on.', 1, 1)NOCOUNT에 해당하는 구성 값이 512이므로 512로 비트 AND 연산을 합니다. 각 구성옵션에 해당 하는 값은 MSDN user options 서버 구성 옵션 구성 항목에서 확인할 수 있습니다. 보다 쉽게 옵션을.. 2017. 12. 8. LinqToDataSet Helper // public static class DataSetHelper { private static bool IsNullableType(Type type) { return (type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable))); } public static DataTable CreateDataTable(this IEnumerable query, string tableName) { DataTable table = new DataTable(tableName); var fields = typeof(T).GetProperties(); // Create columns foreach (var field in fields) { Da.. 2017. 9. 29. ObjectDumper Class // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.IO; using System.Collections; using System.Collections.Generic; using System.Reflection; public class ObjectDumper { public static void Write(object o) { Write(o, 0); } public static void Write(object o, int depth) { Write(o, depth, Console.Out); } public static void Write(object o, int depth, TextWriter log).. 2017. 9. 23. 이전 1 다음 반응형