기본 콘텐츠로 건너뛰기

라벨이 C#인 게시물 표시

Directory FileName Sort

C#에서 Directory.GetFiles(<Path>) 에서 파일명으로 Sort를 할필요성이 있다. Files 배열을 받아서 Sort를 할수도 있지만, Directory class 에서 Sort 기능도 제공을 하는데, LINQ에 Sort 기능을 제공한다. To sort by name, var sorted = Directory . GetFiles ( "." ). OrderBy ( f => f ); To sort by size, var sorted = Directory . GetFiles ( "." ). OrderBy ( f => new FileInfo ( f ). Length ); 참고   http://stackoverflow.com/questions/6294275/sorting-the-result-of-directory-getfiles-in-c-sharp

C# Namespace Naming Guidelines

The general rule for naming namespaces is to use the company name followed by the technology name and optionally the feature and design as follows. CompanyName.TechnologyName[.Feature][.Design] For example: Microsoft.Media Microsoft.Media.Design Prefixing namespace names with a company name or other well-established brand avoids the possibility of two published namespaces having the same name. For example,  Microsoft.Office  is an appropriate prefix for the Office Automation Classes provided by Microsoft. Use a stable, recognized technology name at the second level of a hierarchical name. Use organizational hierarchies as the basis for namespace hierarchies. Name a namespace that contains types that provide design-time functionality for a base namespace with the  .Design  suffix. For example, the  System.Windows.Forms.Design Namespace  contains designers and related classes used to design  System.Windows.Forms...