工作小记

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);

   

}

 

 

 

 

查看sharepointlog

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

http://channel9.msdn.com/posts/DanielMoth/Multi-threading-Debugging-Enhancements-in-Visual-Studio-2008/

 

debug—>windowsàthread

 

 

 

adding an extra server to an existing sharepoint farm:

http://sharepointnotes.wordpress.com/2008/01/10/adding-an-extra-server-to-an-existing-sharepoint-farm/

Install MOSS and join the server to the existing farm

  1. Install using the MOSS installation account
  2. Start MOSS Setup, enter your license key and accept the license agreement
  3. Select Advanced and Complete install
  4. Run the SharePoint Product and Technologies Configuration Wizard
  5. Connect to an existing farm
  6. 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
  7. In Advanced Setting make sure that this server will not host the Central Administration site and click Next
  8.  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)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值