1 / 26

asp CHAPTER 6 스크립팅 런타임 라이브러리

asp CHAPTER 6 스크립팅 런타임 라이브러리. 천주희 wngml1205@kunsan.ac.kr 군산대학교 정보통계학과 정보과학기술 연구실 2012.07.18. 목차. 스크립팅 런타임 라이브러리 개체 Scripting.Dictionary 개체 Scripting.FileSystemObject 개체 Scripting.TextStream 개체 FileSystemObject 를 응용한 카운터 제작. 스크립팅 런타임 라이브러리 개체 (1/3). 스크립팅 런타임 라이브러리

mendel
Télécharger la présentation

asp CHAPTER 6 스크립팅 런타임 라이브러리

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. aspCHAPTER 6 스크립팅 런타임 라이브러리 천주희 wngml1205@kunsan.ac.kr 군산대학교 정보통계학과 정보과학기술 연구실 2012.07.18

  2. 목차 스크립팅 런타임 라이브러리 개체 Scripting.Dictionary개체 Scripting.FileSystemObject개체 Scripting.TextStream개체 FileSystemObject를 응용한 카운터 제작 IST (Information Sciences & Technology) Laboratory

  3. 스크립팅 런타임 라이브러리 개체 (1/3) • 스크립팅 런타임 라이브러리 • MS사에서 자사의 윈도우 플랫폼에서 좀더 쉽게 프로그래밍할 수 있도록 돕는 Windows Script • Windows Script • 스크립트 사용자가 윈도우 애플리케이션을 좀더 쉽게 스크립팅할 수 있도록 다양한 지원 기술 제공 • ASP 웹 서버뿐만 아니라 인터넷 익스플로러 등에도 탑재되어 많은 작업을 수행할 수 있게 해주는 일종의 개발 도우미 • 스크립트런타임 라이브러리에서 제공하는 주요 개체 • Dictionary 개체 • FileSystemObject개체 • TextStream개체 • RegExp개체 IST (Information Sciences & Technology) Laboratory

  4. 스크립팅 런타임 라이브러리 개체 (2/3) Server.CreateObject(“패키지.컴포넌트명.버전”) VBScript를 사용하는 경우 Dim objFSO Set objFSO=Server.CreateObject("Scripting.FileSystemObject") JScript를 사용하는 경우 varobjFSO=Server.CreateObject("Scripting.FileSystemObject") • 스크립팅 개체와 인스턴스 생성 • 스크립팅 런타임 개체 생성하기 • CreateObject를 사용하여 스크립팅 개체 생성 IST (Information Sciences & Technology) Laboratory

  5. 스크립팅 런타임 라이브러리 개체 (3/3) • 스크립팅 개체와 인스턴스 생성 • VBScript 개체 생성하기 • New 키워드만으로 개체의 인스턴스 생성 가능 IST (Information Sciences & Technology) Laboratory

  6. Scripting.Dictionary개체 (1/) Dictionary 개체 메소드 Dictionary 개체 속성 • Dictionary 개체와 개체 멤버 • VBScript와 Jscript에서 모두 지원하는 개체 • 연관된 데이터를 이름/값 쌍으로 저장 • 2차원 배열과 비슷하지만 인덱스를 포함하지 않음 IST (Information Sciences & Technology) Laboratory

  7. Scripting.Dictionary개체 • Dictionary 개체 제어 • Dictionary 개체를 사용하는 방법 • 개체 생성 • Add() 메소드로 값 지정 • Item(key)메소드로 값 반환 or 변경 • Remove(key) 메소드로 특정 항목 삭제 IST (Information Sciences & Technology) Laboratory

  8. Scripting.FileSystemObject개체 (1/13) • FSO 개체와 FSO 개체 모델 • FileSystemObject개체 • 서버에 허용된 디스크 공간에 대한 액세스를 제공함으로써 파일, 폴더.드라이버에 대한 제어를 ASP 코드를 통해 가능하게 하는 스크립팅 개체 • 웹에서 서버 공간에 있는 디렉터리 생성, 삭제, 덱스트 파일의 생성, 편집, 삭제 등 파일시스템 제어 • 서버측에서만 사용 (클라이언트측 사용을 허용하지 않음) • FSO 개체 모델 • 서버측 애플리케이션에서 폴더를 작성, 변경, 이동, 삭제하거나 특정 폴더의 존재 여부와 위치 검색 • 폴더명이나 만든 날짜, 마지막으로 수정한 날짜 등의 폴더에 관한 정보도 찾을수 있음 IST (Information Sciences & Technology) Laboratory

  9. Scripting.FileSystemObject개체 (2/13) FileSystemObject개체 속성 Drive 관련 메소드 • FSO 개체 멤버 IST (Information Sciences & Technology) Laboratory

  10. Scripting.FileSystemObject개체 (3/13) Folder 관련 메소드 • FSO 개체 멤버 IST (Information Sciences & Technology) Laboratory

  11. Scripting.FileSystemObject개체 (4/13) File 관련 메소드 • FSO 개체 멤버 IST (Information Sciences & Technology) Laboratory

  12. Scripting.FileSystemObject개체 (5/13) [C:\Inetpub\wwwroot\ch6]->[등록 정보]->[보안] [시작]->[프로그램]->[관리도구]->[인터넷 서비스 관리자]->[기본 웹 사이트] • FSO 개체 멤버 • 웹 디렉터리 쓰기 권한 처리하기 IST (Information Sciences & Technology) Laboratory

  13. Scripting.FileSystemObject개체 (6/13) Drive 개체 속성 • Drive 개체 • 웹 서버에 지정된 해당 파일시스템에 대한 상세한 정보를 제공하는 속성을 이용해서 사용 가능한 여유 공간, 드라이브의 파일 시스템, 드라이브의 볼륨명, 드라이브의 크기 등을 확인 가능 • Drive 개체를 사용하여 얻은 대부분의 정보는 읽기전용으로 값을 변경할 수 없음 IST (Information Sciences & Technology) Laboratory

  14. Scripting.FileSystemObject개체 (7/13) • Drive 개체 • Drive 개체로 하드디스크 정보 출력하기 IST (Information Sciences & Technology) Laboratory

  15. Scripting.FileSystemObject개체 (8/13) Folder 개체 메소드 overwrite: 선택, true면 파일을 덮어씀 (기본값 false) unicode : 선택, 유니코드(true)와 아스키(false) 중 어느 것을 만들지 결정 (아스키) • Folder 개체 • 개체가제공하는 속성을 이용해 폴더명, 폴더 크기, 폴더 내의 파일 모임, 해당 폴더의 속성 등 폴더에 대한 정보를 확인 할 때 사용 • 서브 폴더가 있다면 서브 폴더를 나타내는 Folders 컬렉션도 포함할 수 있음 • Folder 개체가 제공하는 메소드를이욜하여 드라이브 내의 폴더를 이동, 복사, 삭제 가능 IST (Information Sciences & Technology) Laboratory

  16. Scripting.FileSystemObject개체 (9/13) Folder 개체 속성 IST (Information Sciences & Technology) Laboratory

  17. Scripting.FileSystemObject개체 (10/13) • Folder 개체 • Folder 개체로 디렉터리 정보 확인하기 IST (Information Sciences & Technology) Laboratory

  18. Scripting.FileSystemObject개체 (11/13) File 개체 속성 • File 개체 • 파일의속성에 대한 액세스 제공, 파일을 다루는 데 필요한 메소드 제공 • FileSystemObject개체의 GetFile메소드나Folder 개체의 Files 컬렉션으로부터 생성 IST (Information Sciences & Technology) Laboratory

  19. Scripting.FileSystemObject개체 (12/13) File 개체 메소드 • File 개체 IST (Information Sciences & Technology) Laboratory

  20. Scripting.FileSystemObject개체 (13/13) • File 개체를 이용하여 특정 폴더에 저장된 파일 목록 출력하기 IST (Information Sciences & Technology) Laboratory

  21. Scripting.TextStream개체 (1/4) TextStream개체의 속성 • TextStream개체 • 파일내용을 읽어오거나 파일에 새로운 내용을 입력할 수 있도록 함 IST (Information Sciences & Technology) Laboratory

  22. Scripting.TextStream개체 (2/4) TextStream개체의 메소드 • TextStream개체 • 파일내용을 읽어오거나 파일에 새로운 내용을 입력할 수 있도록 함 IST (Information Sciences & Technology) Laboratory

  23. Scripting.TextStream개체 (3/4) • 텍스트 파일 제거 • TextStream개체는 확장자가 .txt 파일만 읽고 씀 -> but, 텍스트형식으로 저장되는 모든 파일에 접근 가능 • TextStream개체를이용한 파일 생성, 내용 입력하기 IST (Information Sciences & Technology) Laboratory

  24. Scripting.TextStream개체 (4/4) IST (Information Sciences & Technology) Laboratory

  25. FileSystemObject를 응용한 카운터 제작 (1/) ViewTotalVisit.asp global.asa와FileSystemObject를 이용한 방문객 카운팅 프로그램 작성하기 IST (Information Sciences & Technology) Laboratory

  26. 감사합니다천주희wngml1205@kunsan.ac.kr IST (Information Sciences & Technology) Laboratory

More Related