Use the Sites property of the SPWebApplication class to return a collection of SPSite objects that represent all the site collections for a Web application. To create a site collection, use the Add method.
Use an indexer to return a single site object from the collection. For example, if the collection is assigned to a variable named mySites, use mySites[index] in C#, or mySites(index) in Visual Basic, where index is either the index number of the site object in the collection or the display name of the site.