http://www.sharepoint-tips.com/2006/08/common-and-simple-coding-tasks-in.html
using(SPSite mySite = new SPSite("http://server/sites/site"))
{
using(SPWeb myWeb = mySite.OpenWeb())
{
string linksHtml = "";
foreach(SPList list in myWeb.Lists)
{
string listLink = "<a href='" + list.DefaultView.Url.ToString() + "'>" + list.Title + "</a>(<b>"+list.Items.Count+"</b>)<br>";
linksHtml += listLink;
}
}
}
--
using(SPSite mySite = new SPSite("http://server/sites/site"))
{
using(SPWeb myWeb = mySite.OpenWeb())
{
}
}
--
using(SPSite mySite = new SPSite("http://server/sites/site"))
{
using(SPWeb myWeb = mySite.OpenWeb())
{
string linksHtml = "";
foreach(SPList list in myWeb.Lists)
{
string listLink = "<a href='" + list.DefaultView.Url.ToString() + "'>" + list.Title + "</a>(<b>"+list.Items.Count+"</b>)<br>";
linksHtml += listLink;
}
}
}
------
---------------
http://sharepoint-coding.blogspot.com/
using(SPSite mySite = new SPSite("http://server/sites/site"))
{
using(SPWeb myWeb = mySite.OpenWeb())
{
string linksHtml = "";
foreach(SPList list in myWeb.Lists)
{
string listLink = "<a href='" + list.DefaultView.Url.ToString() + "'>" + list.Title + "</a>(<b>"+list.Items.Count+"</b>)<br>";
linksHtml += listLink;
}
}
}
--
using(SPSite mySite = new SPSite("http://server/sites/site"))
{
using(SPWeb myWeb = mySite.OpenWeb())
{
}
}
--
using(SPSite mySite = new SPSite("http://server/sites/site"))
{
using(SPWeb myWeb = mySite.OpenWeb())
{
string linksHtml = "";
foreach(SPList list in myWeb.Lists)
{
string listLink = "<a href='" + list.DefaultView.Url.ToString() + "'>" + list.Title + "</a>(<b>"+list.Items.Count+"</b>)<br>";
linksHtml += listLink;
}
}
}
------
---------------
http://sharepoint-coding.blogspot.com/