Geekpedia Tutorials Home

Building a C# Chat Client and Server

Building a C# Chat Client and ServerA step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.

in C# Programming Tutorials

Getting Hard Drive Information

Getting Hard Drive InformationA C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

UPS Shipping Calculator

UPS Shipping CalculatorThis tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.

in PHP Programming Tutorials

Create Your Own Rich Text Editor

Create Your Own Rich Text EditorCreating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.

in JavaScript Programming Tutorials
Search
Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

Objects in ASP

How to create a custom object in ASP (done just now for a mate in need...).

On Monday, September 27th 2004 at 06:46 PM
By Matt W (View Profile)
****-   (Rated 3.9 with 11 votes)
Contextual Ads
More ASP Resources
Advertisement


<%
Option Explicit

'
' Class Example just for Neil... <-- a geezer new to ASP
'=======================================
' Imagine an object as a mini program in its own right that gives
' a larger parent program a controlled amount of access.
'
' Basically any code you do inside an object won't affect the rest
' of your code other than by the rules you set.  =O)
'
' Good for security, re-useability and ease of use in the medium/
' long-term of a project.  Basic standard includes that contains 
' loads of function/sub code snippets become cumbersome and messy 
' over time.  Objects solve that issue.
'
' I like keeping 1 object per include... =)  makes it easy to just
' include what I need... =)
'
'
Class MyClass
    '
    '-------------------------------
    ' Properties (local variables)
    '  - You can make them public, but that is insecure and stupid.
    '
    Private i_MyData    ' Used internally, but given secured access
                        ' via Property Let/Get
    Private s_String    ' Only used internally
    '
    '-------------------------------
    ' Property Accessots
    ' - These are the rules for i_MyData (Let/Get)
    '
    Public Property Let MyData(valueIn)
        '
        ' valueIn is the data given to property (as in... property = valueIn)
        '
        If valueIn>777 Then valueIn = 777
        If valueIn<111 Then valueIn = 111
        '
        i_MyData = valueIn
    End Property
    Public Property Get MyData
        '
        ' This allows data to be retrived [as in... Response.write(myObj.MyData) ]
        '
        MyData = i_MyData
    End Property
    
    '
    '-------------------------------
    ' Constructors/Deconstructors/
    '  - These fire when creating/destroying object
    '
    Private Sub Class_Initialize
        '
        ' Use this to set local variables...
        '
        i_MyData = 777 ' Monkeys gone to heaven...
        s_String = "No data here... "
        '
        Response.Write("myClass has started<br>")
    End Sub
    '
    Private Sub Class_Terminate
        '
        ' Use this to clean up
        '
        Response.Write("myClass has stopped<br>")
    End Sub
    
    '-------------------------------
    ' Methods
    '
    Public Sub DoSomething()
        '
        ' internal Sub (called a method)
        '
        Response.Write(s_String & i_MyData & "<br>")
    End Sub
    
    Public Function NonsenseMaths(NumberIn)
        '
        ' internal Function (also called a method)
        '
        If NumberIn>20 Then NumberIn = 20
        If NumberIn<5  Then NumberIn = 5
        '
        NonsenseMaths = i_MyData * NumberIn
    End Function
End Class
'
'================================================================
'
' Now for use...
'
Dim sStick ' This will hold our new object

Set sStick = New MyClass
    Response.write(sStick.MyData)
    Response.write("<br>")
    sStick.MyData = 666 ' the devil (booo!)
    Response.write(sStick.MyData)
    Response.write("<br>")
    sStick.DoSomething()
    Response.write(sStick.NonsenseMaths(9))
    Response.write("<br>")
Set sStick = Nothing
%>
Digg Digg It!     Del.icio.us Del.icio.us     Reddit Reddit     StumbleUpon StumbleIt     Newsvine Newsvine     Furl Furl     BlinkList BlinkList

Rate Rate this tutorial
Comment Current Comments
by gopi on Wednesday, June 14th 2006 at 11:21 AM

Very good for begineers like me!

by ugg boots on Monday, August 1st 2011 at 02:28 AM


[url=http://www.uggnetstore.com ]Australia Sheepskin Ugg Boots on sale,you can buy cheap ugg boots,ugg boots 5815,discount ugg boots 5825,ugg boots 5823,ugg boots for womens,Australia Sheepskin Ugg Boots,ugg winter boots,UGG Bailey Button,UGG Classic Short,UGG Classic Tall,Ugg Classic Cardy.[/url]
[url=http://www.uggnetstore.com/ ]ugg boots[/url]
[url=http://www.uggnetstore.com/ ]cheap uggs[/url]
[url=http://www.uggnetstore.com/ ]UGG Bailey Button[/url]
[url=http://www.uggnetstore.com/ ]UGG Classic Short[/url]
[url=http://www.uggnetstore.com/ ]UGG Classic Short[/url]
[url=http://www.uggnetstore.com/ ]Ugg Classic Cardy[/url]
[url=http://www.uggnetstore.com/ ]ugg winter boots[/url]
[url=http://www.uggnetstore.com/ ]Australia Sheepskin Ugg Boots on sale[/url]
[url=http://www.uggentityshop.com ]Australia Sheepskin Ugg Boots on sale,you can buy cheap ugg boots,ugg boots 5815,discount ugg boots 5825,ugg boots 5823,ugg boots for womens,Australia Sheepskin Ugg Boots,ugg winter boots,UGG Bailey Button,UGG Classic Short,UGG Classic Tall,Ugg Classic Cardy.[/url]
[url=http://www.uggentityshop.com/ ]UGG Bailey Button[/url]
[url=http://www.uggentityshop.com/ ]UGG Classic Short[/url]
[url=http://www.uggentityshop.com/ ]ugg boots[/url]
[url=http://www.uggentityshop.com/ ]cheap uggs[/url]
[url=http://www.uggentityshop.com/ ]Ugg Classic Cardy[/url]
[url=http://www.uggentityshop.com/ ]ugg winter boots[/url]
[url=http://www.uggentityshop.com/ ]Australia Sheepskin Ugg Boots on sale[/url]
[url=http://www.netbuyugg.com ]Australia Sheepskin Ugg Boots on sale,you can buy cheap ugg boots,ugg boots 5815,discount ugg boots 5825,ugg boots 5823,ugg boots for womens,Australia Sheepskin Ugg Boots,ugg winter boots,UGG Bailey Button,UGG Classic Short,UGG Classic Tall,Ugg Classic Cardy.[/url]
[url=http://www.netbuyugg.com/ ]ugg winter boots[/url]
[url=http://www.netbuyugg.com/ ]Australia Sheepskin Ugg Boots on sale[/url]
[url=http://www.netbuyugg.com/ ]ugg boots[/url]
[url=http://www.netbuyugg.com/ ]cheap uggs[/url]
[url=http://www.netbuyugg.com/ ]UGG Bailey Button[/url]
[url=http://www.netbuyugg.com/ ]UGG Classic Short[/url]
[url=http://www.netbuyugg.com/ ]UGG Classic Short[/url]
[url=http://www.netbuyugg.com/ ]Ugg Classic Cardy[/url]
[url=http://www.ibuyugg.com ]Welcome to the cheap uggs|a nature shop website offering a comprehensive range of sheepskin cheap uggs and ugg boots. Aside from our highly competitive pricing,we offer free fast shipping world wide included in all of our prices and a 100% products original package of ugg boots.[/url]
[url=http://www.ibuyugg.com/ugg-classic-short-boots.html ]ugg classic short[/url]
[url=http://www.ibuyugg.com/ ]wholesale ugg boots[/url]
[url=http://www.ibuyugg.com/ ]ugg boots[/url]
[url=http://www.ibuyugg.com/ ]cheap uggs[/url]
[url=http://www.ibuyugg.com/ ]ugg boots sale[/url]
[url=http://www.uggbootsgood.com ]Authentic cheap UGGs store,buy latest styles and cheap UGG Boots.welcome to our professional UGGs for cheap store|offering UGG Boots sale and UGGs outlet on all styles|save up to 70%|free shipping and fast delivery.[/url]
[url=http://www.uggbootsgood.com/ ]ugg boots online[/url]
[url=http://www.uggbootsgood.com/ ]ugg boots sale[/url]
[url=http://www.uggbootsgood.com/ ]ugg boots outlet[/url]
[url=http://www.uggbootsgood.com/ ]uggs for cheap[/url]
[url=http://www.uggbootsgood.com/ ]uggs on sale[/url]
[url=http://www.uggbootsgood.com/ ]ugg australia[/url]
[url=http://www.uggbootsgood.com/ ]ugg boots[/url]
[url=http://www.esaleugg.com ]Welcome to the cheap uggs,a nature shop website offering a comprehensive range of sheepskin cheap uggs and ugg boots. Aside from our highly competitive pricing|we offer free fast shipping world wide included in all of our prices and a 100% products original package of ugg boots.[/url]
[url=http://www.esaleugg.com/ ]uggs outlet[/url]
[url=http://www.esaleugg.com/ ]wholesale ugg boots[/url]
[url=http://www.esaleugg.com/ ]ugg boots[/url]
[url=http://www.esaleugg.com/ ]cheap uggs[/url]
[url=http://www.esaleugg.com/ ]uggs for cheap[/url]
[url=http://www.esaleugg.com/ ]ugg boots sale[/url]
[url=http://www.prettyuggboots.com ]prettyuggboots.com ugg boots website sales AAA replica ugg boots ,50%-70% Off Freeshipping cheap ugg boot,fake ugg boots ,UGG sheepskin shoes,UGG celtic sheepskin,Best after-sale service and fast delivery![/url]
[url=http://www.prettyuggboots.com/ ]ugg boots website[/url]
[url=http://www.prettyuggboots.com/ ]replica ugg boots[/url]
[url=http://www.prettyuggboots.com/ ]ugg boots[/url]
[url=http://www.prettyuggboots.com/ ]cheap uggs[/url]
[url=http://www.prettyuggboots.com/ ]cheap ugg boot[/url]
[url=http://www.prettyuggboots.com/ ]fake ugg boots[/url]
[url=http://www.prettyuggboots.com/ ]wholesale ugg boots[/url]

by web 2.0 linkwheels on Wednesday, December 14th 2011 at 09:40 AM

hi,
its good.
i want to know how can we get the current time without the date.
pls help me

by Replica Watches on Thursday, December 22nd 2011 at 12:55 AM

good

by buy cigarettes online on Wednesday, January 4th 2012 at 04:22 AM

Tremendous article, numerous good quality information.

by Plumber Baldock on Monday, February 13th 2012 at 12:25 AM

Great post.Having a lot of information,s.

by Jannat 2 Songs Download on Thursday, April 5th 2012 at 04:05 AM

Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting.

by Tu Hi Mera Song Download on Thursday, April 5th 2012 at 04:07 AM

I really loved reading your blog. It was very well authored and easy to understand.

by Blood Money Songs Download on Thursday, April 5th 2012 at 04:09 AM


This blog post was absolutely fantastic. When I used to work in electroplating they sometimes encouraged us to write, but I could never come up with something as well written as that

by Bittoo Boss Songs Download on Thursday, April 5th 2012 at 04:11 AM

I really learned a lot from your site. You are doing good work!

by Mp3 Songs Free Download on Thursday, April 5th 2012 at 04:14 AM

I found your site while stumbling. allowed me to really understand this issue.

by best tents on Thursday, April 12th 2012 at 03:58 AM

I like this post, enjoyed this one regards for posting .

by nike shox on Saturday, April 14th 2012 at 04:47 AM


Nike Shox
nike shox rivalry
shox
shox rivalry
nike shox pas cher
shox pas cher


air max pas cher
tn air max pas cher
requin cher
pas cher air max
tn requin
air max tn


TN Requin
Nike TN
Chaussures Nike TN
Nike TN Requin

Nike TN Pas Cher

TN Requin
TN Pas Cher
Nike TN
Nike air max
TN REQUIN
Puma Pas Cher

TN Pas Cher
Nike tn 2012
tn foot locker

by cheap Louis Vuitton handbags on Monday, May 21st 2012 at 10:03 PM

Good post!I was very pleased to find this site.I wanted to thank you for this great read!

by Buy Codeine Online on Monday, May 28th 2012 at 12:25 PM

I am speechless after seeing these pictures! I love them all! I teach kindergarten and I'm going to make a theme, and photographs have given me so many ideas! You are so talented! Thanks!

by locksmith in brooklyn on Tuesday, May 29th 2012 at 07:11 AM

I would learn a lot from your blog here, Keep on going for the good information, my friend, I would keep an eye on it.

by buy phentermine online on Tuesday, May 29th 2012 at 11:03 AM

I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!

by buy medicine on Tuesday, May 29th 2012 at 11:12 AM

I am very happy to be here because this is a very good site that provides lots of information about the topics covered in depth. Im glad to see that people are actually writing about this issue in such a smart way, showing us all different sides to it. Please keep it up. I cant wait to read whats next.

by buy xanax online on Tuesday, May 29th 2012 at 01:43 PM

Great blog. All posts have something to learn. Your work is very good and i appreciate you and hopping for some more informative posts.

by buy vicodin online on Tuesday, May 29th 2012 at 03:06 PM

I agree with you. This post is truly inspiring. I like your post and everything you share with us is current and very informative, I want to bookmark the page so I can return here from you that you have done a fantastic job ...

by buy adderall online on Tuesday, May 29th 2012 at 03:12 PM

I am speechless after seeing these pictures! I love them all! I teach kindergarten and I'm going to make a theme, and photographs have given me so many ideas! You are so talented! Thanks!

by Seo Services Cost on Tuesday, May 29th 2012 at 05:02 PM

Thanks for your many years of a great service well done! I’ve always felt good about listing my concerts with you and linking from my website.

by buy valium online on Tuesday, May 29th 2012 at 05:15 PM

Certainly a fantastic piece of work ... It has relevant information. Thanks for posting this. Your blog is so interesting and very informative.Thanks sharing. Definitely a great piece of work Thanks for your work.

by Hyperextension bench on Friday, June 1st 2012 at 01:33 AM

This blog seems to me quite weird but interesting. Perhaps I will go on to read it

by on Monday, June 11th 2012 at 05:59 PM

asdasd

by Commodity tips on Monday, September 17th 2012 at 03:43 AM

hello

by Silver Spring Locksmith on Thursday, November 15th 2012 at 04:44 AM

If you want individuals to get noticable your faults, begin providing guidance.
http://www.dckeyslocksmith.com/

by Ignition Lock on Thursday, November 22nd 2012 at 12:16 AM

The topic is too exciting, thanks for sharing
http://www.dckeyslocksmith.com/


Comment Comment on this tutorial
Name: Email:
Message:
Comment Related Tutorials
There are no related tutorials.

Comment Related Source Code
There is no related source code.

Jobs ASP Job Search
My skills include:
Enter a City:

Select a State:


Advanced Search >>
Ads

From the creators of Geekpedia, a revolutionary new coupon website!

BargainEZ has coupons codes, printable coupons, bargains and it is the leading source of Passbook coupons for iPhone and iPod touch devices.

Coupons
Discover Geekpedia
Other Resources