'프로그래밍/C#'에 해당되는 글 3건

  1. 2011.03.11 WCF를 이용한 대용량 데이터 전송 기법 8
  2. 2009.01.29 [C#] 멀티 업로드 소스 2
  3. 2008.12.30 C# 가상메서드와 추상클래스 1
2011. 3. 11. 14:57
마이크로소프트웨어 마이크로소프트웨어 2008년 02월호
[ INSIDE DEVELOPER|WCF를 이용한 대용량 데이터 전송 기법 / 유경상 ]


Powered by 'http://www.moazine.com'
Posted by 굿데이
2009. 1. 29. 16:54

private void SaveToFile(string UploadDir, ref System.Web.HttpFileCollection UploadFile)
  {
   string FileName, FileExt;
   int FileCnt;
   long FileSize;
   for (FileCnt = 0; FileCnt < UploadFile.Count; FileCnt++)
   {
    System.Web.HttpPostedFile CurFile = UploadFile.Get(FileCnt);
    FileName = System.IO.Path.GetFileName(CurFile.FileName);
    FileSize = CurFile.ContentLength / 1000;   // Kbyte 단위
    if(FileName != "")
    {
     FileExt = System.IO.Path.GetExtension(FileName);
     if (FileExt == ".aspx" || FileExt == ".asp")
     {
      myFunction.PrintMsgBack("확장자가 asp, aspx 파일은 업로드 하실수 없습니다.");
     }
     else
     {
      FileInfo saveFile;
      do
      {
       saveFile = new FileInfo(UploadDir + FileName);
       if(saveFile.Exists)
       {
        FileName = FileName.Replace(".","1.");
       }
      }
      while(saveFile.Exists);
      FileNames += FileName + (char)5;
      FileSizes += FileSize.ToString() + (char)5;
      CurFile.SaveAs(UploadDir + FileName);
     }
    }
   }
  }

출처 : Tong - centerkjh님의 Visual C#통

Posted by 굿데이
2008. 12. 30. 11:30

가상(virtual)메서드
 => 상속받는 클래스의 형변환을 위해 사용

추상클래스: 추상(abstract)메서드를 하나 이상 가지고 있는 클래스
 => 다중상속을 위해 사용

인터페이스(interface)
 => 다중상속을 위해 사용

추상클래스와 인터페이스의 차이점
 1) 추상클래스는 추상클래스를 상속받을수 있고, 일반클래스에 상속을 할 수 있지만,
     인터페이스는 오직 인터페이스 사이에서만 상속이 가능하다.
 2) 인터페이스는 접근권한자를 사용하지 않지만, 추상 클래스는 사용을 한다.
 3) 추상 클래스는 여러 형태의 구현을 포함할 수 있지만, 인터페이스는 할 수 없다.
 4) 인터페이스는 추상 메소드를 포함할 수 없다.


개념정리중...

Posted by 굿데이