一、在VS2005中新建立一个项目或者网站
二、在CS文件中记得添加以下代码:
using Microsoft.SharePoint;
三、把项目或者网站的目录拷贝到以下路径:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS
四、访问方法:http://Server_Name/[sites/][Site_Name/]_layouts/Web_Application_Name/Default.aspx.
例如本人的测试项目访问地址如下:http://gzcxxgc14t/sites/wss3/_layouts/wss3ApplicationWeb/default.aspx

OK,就这么简单!

附上一些常用代码:
返回一个网站集下的全部网站以及网站下面的列表名称的代码:
wss3 sdk学习笔记二:建立一个SharePoint网站应用SPSite mySite = SPContext.Current.Site;
wss3 sdk学习笔记二:建立一个SharePoint网站应用SPWebCollection subSites 
= mySite.AllWebs;
wss3 sdk学习笔记二:建立一个SharePoint网站应用
wss3 sdk学习笔记二:建立一个SharePoint网站应用
for (int i=0;i<subSites.Count;i++)
}

新建立一个子网站的代码:
wss3 sdk学习笔记二:建立一个SharePoint网站应用SPWeb mySite = SPContext.Current.Web;
wss3 sdk学习笔记二:建立一个SharePoint网站应用SPWebCollection subSites 
= mySite.Webs;
wss3 sdk学习笔记二:建立一个SharePoint网站应用
string currentTemplate = mySite.WebTemplate;
wss3 sdk学习笔记二:建立一个SharePoint网站应用
wss3 sdk学习笔记二:建立一个SharePoint网站应用
string siteUrl = TextBox1.Text.ToString();
wss3 sdk学习笔记二:建立一个SharePoint网站应用
string siteTitle = TextBox2.Text.ToString();
wss3 sdk学习笔记二:建立一个SharePoint网站应用
string siteDescription = TextBox3.Text.ToString();
wss3 sdk学习笔记二:建立一个SharePoint网站应用
wss3 sdk学习笔记二:建立一个SharePoint网站应用subSites.Add(siteUrl, siteTitle, siteDescription, 
1033
wss3 sdk学习笔记二:建立一个SharePoint网站应用   currentTemplate, 
truefalse); 

删除一个子网站的代码:
wss3 sdk学习笔记二:建立一个SharePoint网站应用string deleteSite = TextBox1.Text.ToString();
wss3 sdk学习笔记二:建立一个SharePoint网站应用
wss3 sdk学习笔记二:建立一个SharePoint网站应用SPSite mySite 
= SPContext.Current.Site;
wss3 sdk学习笔记二:建立一个SharePoint网站应用SPWebCollection sites 
= mySite.AllWebs;
wss3 sdk学习笔记二:建立一个SharePoint网站应用
wss3 sdk学习笔记二:建立一个SharePoint网站应用sites.Delete(deleteSite); 

新建立一个网站集的代码:
wss3 sdk学习笔记二:建立一个SharePoint网站应用SPWebApplication webApplication = SPContext.Current.Site.WebApplication;
wss3 sdk学习笔记二:建立一个SharePoint网站应用SPSiteCollection siteCollections 
= webApplication.Sites;
wss3 sdk学习笔记二:建立一个SharePoint网站应用
wss3 sdk学习笔记二:建立一个SharePoint网站应用siteCollections.Add(
"http://Server_Name/sites/Site_Collection_Name",
wss3 sdk学习笔记二:建立一个SharePoint网站应用
"User_Name","User_Email ");

相关文章: