Several ways to open the site
1. If you want to open your site, you are using SPWEB and SPControl to open.
Note: I want to reference Microsoft.Sharpoint and Microsoft.Sharpoint.WebControls
SPWEB mysite = spControl.getContextWeb (Context);
2. If you want to access other sites of the current virtual server
SPWEB Site = SPControl.getContextsite (Context) .allwebs [@ "/ c1 / document center /"];
You can also:
SPSite myweb = spControl.getContextsite (Context);
SPWEB mysite = myweb.allwebs [@ "/ c1 / document center /"];
3. Access to different sites of different virtual servers
SPSite SiteCollection = New SPSite ("http://zhouyi1095.test.net/");
SPWEB Site = SiteCollection.allwebs [@ "/ c1 / document center /"];