工作小记

简介:

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


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yjf512/archive/2010/02/24/5321839.aspx

目录
相关文章
|
Java 程序员
工作中遇到的点滴
工作中遇到的点滴
63 0
|
6月前
|
数据采集 分布式计算 DataWorks
准备工作
本文档介绍了阿里云智能推荐服务的使用流程,包括数据准备、行为埋点逻辑核对和数据上传方案。内容涉及不同行业的数据规范,如内容、电商和新闻行业,以及测试数据的获取。数据上传分为启动数据和实时数据两步,提供了全服务端SDK和友盟+服务端SDK等多种上传方案。此外,还介绍了通过历史数据启动实例的方法。建议用户根据自身行业和数据情况选择合适的方案。
47 4
|
开发者
思考你的工作
为什么你明明每天工作很努力,但依然感觉自己的技术进步很慢?
61 0
如此之乱的思绪,如何才能专心工作?
      最近的思维特别的乱,乱得乱七八糟的。写一下也许能好一点点。 女朋友(难找哇) 谈恋爱(花钱呀) 见父母(不好过关呀) 买房子(没钱呀) 生小孩(养不起呀) 买奶粉(国内的有毒,国外的太贵) 欧洲弄一个告诉粒子流的对撞,不知道会装出个什么结果。
978 0
有效的工作,小记
    最近做的一个功能,一个静态页面上有很多需要翻译,需要替换的文本,由于网站上有翻译界面,只需做个关键词入库操作即可, 所以简单写了几句代码,代替人工操作。     1.通过http爬取网页html,然后正则匹配标签内的文本,添加到集合     2.遍历集合做入库操作                              循环插入的性能不好,应该用批量插入的做法,不过数据不多,就没整那么复杂了。
835 0
|
Web App开发 移动开发 前端开发
工作中的一些知识总结
跳转 跳转登陆页 if(HybridMethod.isApp()) { RainbowBridge.callMethod('JsInvokeAppScope', 'goLogin'); } else { var _index = window.
1993 0
|
Web App开发 消息中间件 NoSQL