Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP example

ASP example

Basics

Writing Text with ASP

Adding HTML to Text

Variables

Declare variables

Declaring Arrays

Generating HTML Headings in a Loop

Creating a Time-Based Greeting with VBScript

Creating a Time-Based Greeting with JavaScript

Date/Time Functions (VBScript)

Dates and times

Getting the Name of the Day

Getting the Name of the Month

Getting Today's Month and Day

Countdown to 3000

Calculating N Days from Today

Formatting dates and times

Is This a Date?

Other Functions (VBScript)

Uppercase or Lowercase Strings

Trimming Leading and Trailing Spaces from a String

How to Convert a String?

Rounding

A Random Number

Returning a Specific Character from a String

Replacing Specific Characters in a String

Returning a Specified Number of Characters from a String

Program

Calling a Subroutine Written in VBScript

Calling a Subroutine Written in JavaScript

Calling Subroutines Written in VBScript and JavaScript

The form

Using a Form with method="get"

Using a Form with method="post"

Using a Form with Radio Buttons

Cookie

Welcome cookie

Response Object

Writing Text with ASP

Formatting Text with HTML Tags in ASP

Redirecting Users to a Different URL

Displaying a Random Link

Controlling Caching

Clear the cache

Ending the Script During Processing and Returning a Result

Setting How Many Minutes a Page Is Cached in the Browser Before It Expires

Setting the Expiration Date or Time for a Page Cached in the Browser

Checking Whether a User Is Still Connected to the Server

Setting the Content Type

Setting the Character Set

Request Object

Passing Parameters Through a URL

A Simple Application of the QueryString Collection

Getting Information from a Form

Getting More Information from a Form

A Simple Application of the Form Collection

How to Use Information from a Form

Getting More Information from a Form

A Form with Radio Buttons

A Form with Checkboxes

How to Get a Visitor's Browser Type, IP Address, and More

Getting All Requested Server Variables

Welcome cookie

Total Number of Bytes Sent by the User

Session Object

Returning the SessionID

Session Timeout

Server Object

When Was This File Last Modified?

Opening and Reading a Text File

A Homemade Hit Counter

FileSystem Object

Does the Specified File Exist?

Does the Specified Folder Exist?

Does the Specified Drive Exist?

Getting the Name of a Specified Drive

Getting the Name of the Parent Folder of a Specified Path

Getting a File Extension

Getting the Base Name of a File or Folder

TextStream Object

Reading a Text File

Reading Part of a Text File

Reading a Line from a Text File

Reading All Lines of a Text File

Skipping Part of a Text File

Skipping a Line in a Text File

Returning the Line Count

Getting the Column Count

Drive Object

Getting the Available Space on a Specified Drive

Getting the Free Space on a Specified Drive

Getting the Total Capacity of a Specified Drive

Getting the Drive Letter of a Specified Drive

Getting the Drive Type of a Specified Drive

Getting the File System Information of a Specified Drive

Is the Drive Ready?

Getting the Path of a Specified Drive

Getting the Root Folder of a Specified Drive

Getting the Serial Number of a Specified Drive

File Object

When a File Was Created

When This File Was Modified

When This File Was Last Accessed

Returning the Attributes of a Specified File

Dictionary Object

Does the Specified Key Exist?

Returning an Array of All Items

Returning an Array of All Keys

Returning the Value of an Item

Setting a Key

Returning the Number of Key/Item Pairs

AdRotator Component

A Simple AdRotator Example

Browser Capabilities Component

The type, capabilities, and version number of every browser that visits the site

ContentRotator Component

Content Rotator Component

Content Linking Component

Content Linking Component

Content Linking Component 2