Windows Scripting Components (WSC) in ASP
page 3 of 4
by . .
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 32322/ 37

Using the Script

Using the Script

Ok, now we can use the script in ASP. Your ASP file should look something like this -

<%

Set objWSC = CreateObject("testscript.wsc")
Response.Write(objWSC.Print("Hello"))
Response.Write(objWSC.CalcTax(5.20) & "<br>")
'Response.Write(objWSC.privated & "<br>")

%>

This code should be familiar to you. It creates the object like any other ASP component and then we proceed to print various things to the screen -

Hello Printed by WSC
5.85

I commented out the last line because you will get an error (because, if you remember, it's a private property). Also, we used CalcTax instead of Tax on the second line.

You can also use the Script in your page if its on another server i.e.

<%

Set objWSC = CreateObject("testscript.wsc", "box2")

%>

Uses the testscript.wsc on the computer called box2.


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-20 9:34:31 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search