ASP Lecture 3, Installable Components - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

ASP Lecture 3, Installable Components

Description:

COM is the interface standard for these objects which have methods and properties ... Others: Ad Rotator, Content Linking, Content Rotator, Counters, File Access, ... – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 5
Provided by: aurora5
Category:

less

Transcript and Presenter's Notes

Title: ASP Lecture 3, Installable Components


1
ASP Lecture 3, Installable Components
  • ASP programs have access to intrinsic objects
    (Request, Response, Application, Session, Server)
  • Other objects can be installed
  • Standard library
  • Built for a particular application
  • COM is the interface standard for these objects
    which have methods and properties
  • Examples (ASP in a Nutshell, Ch. 11-21)
  • Collaboration Data Objects CDONTS
  • ActiveX Data Objects ADODB
  • Others Ad Rotator, Content Linking, Content
    Rotator, Counters, File Access, Page Counter,
    Permission Checker

2
Collaboration Data Objects (CDO)
  • CDO adds messaging functions to applications.
    CDONTS is a COM library for NT designed to send
    mail through SMTP
  • To create the CDONTS object
  • Dim objCDOMail 'The CDO object
  • Set objCDOMail Server.CreateObject("CDONTS.NewMa
    il")
  • This has
  • Attributes From, To, Subject, Body, Cc, Bcc,
    AttachFile, ...
  • Method Send
  • Procedure
  • assign values to the attributes
  • apply Send

3
Sending a simple message
  • Dim objCDOMail
  • Set objCDOMail
  • Server.CreateObject("CDONTS.NewMail")
  • objCDOMail.To ashilepsly_at_wells.edu
  • objCDOMail.From cshilepsly_at_wells.edu
  • objCDOMail.Subject Dinner
  • objCDOMail.Body Lets go out
  • objCDOMail.Send
  • Example http//www.asp101.com/samples/email_cdo.a
    sp

4
File Access
  • Access to a file system via the FileSystemObject
  • Server.CreateObject(Scripting.FileSystemObject)
  • File system has folders, drives, files
  • Methods CreateFolder, CreateTextFile,
    DriveExists, DeleteFile, GetFile, OpenTextFile,
    ...
  • Text file methods Read, ReadLine, Write,
  • Examples
  • http//www.asp101.com/samples/counter.asp
  • http//www.asp101.com/samples/modified.asp
  • http//www.asp101.com/samples/textfile.asp
Write a Comment
User Comments (0)
About PowerShow.com