C#中使用PowerShell:
Process process = new Process();
// Redirect the output stream of the child process.
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = "powershell";
process.StartInfo.Arguments = @"./Build-TestSuite.ps1 " + BuildDestFolder + " " + protocol.ShortName + " " + protocol.Family;
process.Start();
// Wait for exit
process.WaitForExit();
sharepoint的数据库结构:
Using these procedures, the DBA will create databases and the farm administrator will perform other configuration actions in the following order:
1. · The configuration database (only one per farm).
2. · The content database for Central Administration (only one per farm).
3. · Central Administration Web application (only one per farm, created by Setup).
4. · The Windows SharePoint Services search database (only one per farm).
5. · Start the Office SharePoint Search service.
For each portal site:
6. · Portal site Web application content database.
For each SSP:
7. · A content database for the My Sites Web application (if the SSP is using its own Web application).
8. · A content database for the Shared Services Administration Web application (if the SSP is using its own Web application).
9. · SSP Search database (one per SSP).
10. · SSP Web application (created by Setup if the SSP is using its own Web application).
Note:
As part of the Web site and application pool creation process, a Web application is also created in Internet Information Services (IIS). Extending a Web application will create an additional Web site in IIS, but not an additional application pool.
private bool ExtractCabinet()
{
bool extractStatus = false;
try
{
System.Diagnostics.Process extractor = new System.Diagnostics.Process();
extractor.StartInfo.UseShellExecute = true;
extractor.StartInfo.CreateNoWindow = true;
extractor.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
extractor.StartInfo.FileName = "extrac32.exe";
extractor.StartInfo.Arguments = "/e /l " + this.targetLocation + " " + this.parserLocation + "dp.cab";
if (extractor.Start())
extractStatus = true;
}
catch (Exception)
{ }
return extractStatus;
}
Sharepoint 的dll在:
C:/program files/common files/microsoft shared/web server extensions/12/isapi
Workflow 指的是“工作流(Workflow)就是“业务过程的部分或整体在计算机应用环境下的自动化”,它主要解决的是“使在多个参与者之间按照某种预定义的规则传递文档、信息或任务的过程自动进行,从而实现某个预期的业务目标,或者促使此目标的实现”。
http://tech.ddvip.com/2009-11/1257623583137772.html
Create and Publish web pages in Publishing SharePoint sites programmatically
using (SPSite site = new SPSite("http://moss"))
{
using (SPWeb web = site.OpenWeb())
{
PublishingSite pSite = new PublishingSite(site);
SPContentType ctype = pSite.ContentTypes["Welcome Page"];
PageLayoutCollection pageLayouts = pSite.GetPageLayouts(ctype, true);
PageLayout pageLayout = pageLayouts["/_catalogs/masterpage/welcomesplash.aspx"];
PublishingWeb pWeb = PublishingWeb.GetPublishingWeb(web);
PublishingPageCollection pPages = pWeb.GetPublishingPages();
PublishingPage pPage = pPages.Add("Programmatic_Test.aspx", pageLayout);
SPListItem newpage = pPage.ListItem;
newpage["Title"] = "Page added programmatically";
newpage.Update();
newpage.File.CheckIn("all looks good");
newpage.File.Publish("all looks good");
}
}
用code判断一个webservice是否是正确的:
利用 HttpWebRequest.GetResponse() 后检查其 StatusCode,不大于 400 则可判断此 URL 服务有效。 try {
// Create a web request for an invalid site. Substitute the "invalid site" strong in the Create call with a invalid name.
HttpWebRequest myHttpWebRequest = (HttpWebRequest) WebRequest.Create("invalid site");
// Get the associated response for the above request.
HttpWebResponse myHttpWebResponse = (HttpWebResponse) myHttpWebRequest.GetResponse();
myHttpWebResponse.Close();
}
catch(WebException e) {
Console.WriteLine("This program is expected to throw WebException on successful run."+
"/n/nException Message :" + e.Message);
if(e.Status == WebExceptionStatus.ProtocolError) {
Console.WriteLine("Status Code : {0}", ((HttpWebResponse)e.Response).StatusCode);
Console.WriteLine("Status Description : {0}", ((HttpWebResponse)e.Response).StatusDescription);
}
查看sharepoint的log:
Central Administration > Operations > Diagnostic Logging
C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/12/LOGS
Sharepoiont designer 2007 对应server 2007
2010 对应10
-
多线程debug:
debug—>windowsàthread
adding an extra server to an existing sharepoint farm:
Install MOSS and join the server to the existing farm
- Install using the MOSS installation account
- Start MOSS Setup, enter your license key and accept the license agreement
- Select Advanced and Complete install
- Run the SharePoint Product and Technologies Configuration Wizard
- Connect to an existing farm
- Enter the MOSS database server end click Retrieve Database Names. The Database Name and Username fields are automatically populated. Enter the password and click Next
- In Advanced Setting make sure that this server will not host the Central Administration site and click Next
- That’s it. The new server is now member of the farm. Use Central Administration to configure it for the purpose it is intended (Web Front-end, indexing etc)