<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://ioriwellings.spaces.live.com/mmm2008-07-24_12.50/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fioriwellings.spaces.live.com%2fcategory%2fSharePoint%2bServices%2b2__x10%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>不及格的程序员-八神: SharePoint Services 2.0</title><description /><link>http://ioriwellings.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=catSharePoint%2bServices%2b2__x10</link><language>en-US</language><pubDate>Thu, 14 Aug 2008 06:40:01 GMT</pubDate><lastBuildDate>Thu, 14 Aug 2008 06:40:01 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://ioriwellings.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>-3107968651015171382</live:id><live:alias>ioriwellings</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>附件管理web服务 组件</title><link>http://ioriwellings.spaces.live.com/Blog/cns!D4DE46FA8730D2CA!1078.entry</link><description>&lt;div&gt;星期三 天气:小雨转中雨&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;外面从早上 就一直在下雨&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;最近公司 将以前存在数据库中的附件 要拿出来 原因是 数据库太大了.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;打算将附件 存到另一台服务器上 该服务器 装有Sharepoint Serices &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;pre style="overflow:auto;width:500px;height:300px"&gt;&lt;p&gt;using System;&lt;br&gt;using System.Collections;&lt;br&gt;using System.ComponentModel;&lt;br&gt;using System.Data;&lt;br&gt;using System.Diagnostics;&lt;br&gt;using System.Web;&lt;br&gt;using System.Web.Services;&lt;br&gt;using System.Runtime.InteropServices;&lt;p&gt; &lt;p&gt;using Microsoft.SharePoint;&lt;br&gt;using Microsoft.SharePoint.SoapServer;&lt;p&gt; &lt;p&gt;namespace dysoft.WSSFileServices&lt;br&gt;{&lt;br&gt; [WebService(Namespace=&amp;quot;&lt;a href="http://ens.dongyu.com.cn/WSS"&gt;http://ens.dongyu.com.cn/WSS&lt;/a&gt;&amp;quot;)]&lt;br&gt; public class CDocumentManager : System.Web.Services.WebService&lt;br&gt; {&lt;br&gt;  private const string DEFAULT_CONTENT_TYPE = &amp;quot;application/unknown&amp;quot;;&lt;br&gt;  public CDocumentManager()&lt;br&gt;  {&lt;br&gt;   InitializeComponent();&lt;br&gt;  }&lt;p&gt; &lt;p&gt;  #region 组件设计器生成的代码&lt;br&gt;  &lt;br&gt;  //Web 服务设计器所必需的&lt;br&gt;  private IContainer components = null;&lt;br&gt;    &lt;br&gt;  /// &amp;lt;summary&amp;gt;&lt;br&gt;  /// 设计器支持所需的方法 - 不要使用代码编辑器修改&lt;br&gt;  /// 此方法的内容。&lt;br&gt;  /// &amp;lt;/summary&amp;gt;&lt;br&gt;  private void InitializeComponent()&lt;br&gt;  {&lt;br&gt;  }&lt;p&gt; &lt;p&gt;  /// &amp;lt;summary&amp;gt;&lt;br&gt;  /// 清理所有正在使用的资源。&lt;br&gt;  /// &amp;lt;/summary&amp;gt;&lt;br&gt;  protected override void Dispose( bool disposing )&lt;br&gt;  {&lt;br&gt;   if(disposing &amp;amp;&amp;amp; components != null)&lt;br&gt;   {&lt;br&gt;    components.Dispose();&lt;br&gt;   }&lt;br&gt;   base.Dispose(disposing);  &lt;br&gt;  }&lt;br&gt;  &lt;br&gt;  #endregion&lt;p&gt; &lt;p&gt;  [WebMethod]&lt;br&gt;  public void Upload(string strDirName, string strFileName, byte[] bContent)&lt;br&gt;  { &lt;p&gt; &lt;p&gt;   if(strDirName.EndsWith(&amp;quot;/&amp;quot;))&lt;br&gt;   {&lt;br&gt;    this.Upload(strDirName + strFileName, bContent);&lt;br&gt;   }&lt;br&gt;   else&lt;br&gt;   {&lt;br&gt;    this.Upload(strDirName + &amp;quot;/&amp;quot; + strFileName, bContent);&lt;br&gt;   }&lt;p&gt; &lt;p&gt;   #region 技术调研时写的&lt;br&gt;   /*&lt;br&gt;   Microsoft.SharePoint.SPWebCollection oWebs = Microsoft.SharePoint.WebControls.SPControl.GetContextSite(this.Context).AllWebs;&lt;br&gt;   System.Text.StringBuilder strResult = new System.Text.StringBuilder();&lt;br&gt;   &lt;br&gt;   foreach(Microsoft.SharePoint.SPWeb oWeb in oWebs)&lt;br&gt;   {    &lt;br&gt;    strResult.Append(oWeb.Url + &amp;quot;,name=&amp;quot; + oWeb.Name + &amp;quot; : &amp;quot; +oWeb.Webs.Count.ToString() + &amp;quot;\n&amp;quot;);&lt;br&gt;    strResult.Append(&amp;quot;--&amp;quot;+oWeb.Webs.Names + &amp;quot;\n&amp;quot;);&lt;br&gt;    strResult.Append(&amp;quot;Shared Documents: &amp;quot; + oWeb.GetFolder(&amp;quot;Shared Documents&amp;quot;).Exists.ToString() + &amp;quot;\n&amp;quot;);&lt;br&gt;    SPFolderCollection folders = oWeb.Folders;&lt;br&gt;    foreach (SPFolder folder in folders)&lt;br&gt;    {&lt;br&gt;     strResult.Append(&amp;quot;  &amp;quot; + folder.Name + &amp;quot;\n&amp;quot;);&lt;br&gt;    }&lt;br&gt;    Microsoft.SharePoint.SPWeb oCurrentWeb = Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(this.Context);&lt;br&gt;    strResult.Append( oCurrentWeb.Name + &amp;quot;\n&amp;quot; + oCurrentWeb.Url);&lt;br&gt;   }&lt;br&gt;   Microsoft.SharePoint.SPWeb oIoriWeb = oWebs[0].Site.OpenWeb(&amp;quot;/Sites/Iori/&amp;quot;);&lt;br&gt;   SPFolderCollection folders1 = oIoriWeb.Folders;&lt;br&gt;   foreach (SPFolder folder in folders1)&lt;br&gt;   {&lt;br&gt;    strResult.Append(&amp;quot;  &amp;quot; + folder.Name + &amp;quot;\n&amp;quot;);&lt;br&gt;   }&lt;br&gt;   if(false)&lt;br&gt;   {&lt;br&gt;    for(int i=0; i&amp;lt; 100; i++)&lt;br&gt;    {&lt;br&gt;     strResult.Append(oIoriWeb.GetFolder(&amp;quot;DocLib/TestFolder&amp;quot;).Files.Add(&amp;quot;test&amp;quot; + i.ToString(&amp;quot;00&amp;quot;) + &amp;quot;.txt&amp;quot;, System.Text.Encoding.UTF7.GetBytes(new string('a',8*1024))));&lt;br&gt;     System.Threading.Thread.Sleep(2);&lt;br&gt;    }&lt;br&gt;   }else{&lt;br&gt;   &lt;br&gt;    Microsoft.SharePoint.SPFileCollection oFiles = oIoriWeb.GetFolder(&amp;quot;DocLib/TestFolder&amp;quot;).Files;&lt;br&gt;    foreach(Microsoft.SharePoint.SPFile oFile in oFiles)&lt;br&gt;    {&lt;br&gt;     oIoriWeb.GetFolder(&amp;quot;DocLib/TestFolder&amp;quot;).Files.Delete(oFile.Url);&lt;br&gt;    }&lt;br&gt;   }&lt;br&gt;   &lt;br&gt;   oIoriWeb.Close();&lt;br&gt;   return strResult.ToString();&lt;br&gt;   */&lt;br&gt;   #endregion&lt;br&gt;  }&lt;p&gt; &lt;p&gt;&lt;br&gt;  [WebMethod(MessageName=&amp;quot;UploadWithFullPath&amp;quot;)]&lt;br&gt;  public void Upload(string strFullPath, byte[] bContent)&lt;br&gt;  { &lt;br&gt;   &lt;br&gt;   Microsoft.SharePoint.SPWeb oCurrentWeb = Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(this.Context);   &lt;br&gt;   Microsoft.SharePoint.SPFolder oFolder = oCurrentWeb.GetFolder(&amp;quot;DocLib/&amp;quot; + System.IO.Path.GetDirectoryName(strFullPath));&lt;br&gt;   if(oFolder != null &amp;amp;&amp;amp; oFolder.Exists)&lt;br&gt;   {&lt;br&gt;    oFolder.Files.Add(System.IO.Path.GetFileName(strFullPath), bContent, true);&lt;br&gt;    return;&lt;br&gt;   }&lt;br&gt;   throw new System.IO.FileNotFoundException(&amp;quot;指定的文件夹不存在.&amp;quot;+&amp;quot;DocLib/&amp;quot; + System.IO.Path.GetDirectoryName(strFullPath));&lt;br&gt;   &lt;br&gt;  } &lt;br&gt;  &lt;p&gt; &lt;p&gt;  [WebMethod]&lt;br&gt;  public byte[] GetFile(string strDirName, string strFileName, out string strContentType)&lt;br&gt;  {&lt;br&gt;   if(strDirName.EndsWith(&amp;quot;/&amp;quot;))&lt;br&gt;   {&lt;br&gt;    return this.GetFile(strDirName + strFileName, out strContentType);&lt;br&gt;   }&lt;br&gt;   else&lt;br&gt;   {&lt;br&gt;    return this.GetFile(strDirName + &amp;quot;/&amp;quot; + strFileName, out strContentType);&lt;br&gt;   }&lt;br&gt;  }&lt;br&gt;  &lt;p&gt; &lt;p&gt;  [WebMethod(MessageName=&amp;quot;GetFileWithFullPath&amp;quot;)]&lt;br&gt;  public byte[] GetFile(string strFullPath, out string strContentType)&lt;br&gt;  {&lt;br&gt;   strContentType = this.GetFileType(strFullPath);&lt;br&gt;   byte[] bContent;&lt;br&gt;   Microsoft.SharePoint.SPWeb oCurrentWeb = Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(this.Context);   &lt;br&gt;   Microsoft.SharePoint.SPFolder oFolder = oCurrentWeb.GetFolder(&amp;quot;DocLib/&amp;quot; + System.IO.Path.GetDirectoryName(strFullPath));&lt;br&gt;   if(oFolder != null &amp;amp;&amp;amp; oFolder.Exists)&lt;br&gt;   {&lt;br&gt;    try&lt;br&gt;    {&lt;br&gt;     Microsoft.SharePoint.SPFile oFile = oFolder.Files[System.IO.Path.GetFileName(strFullPath)];&lt;br&gt;     if(oFile != null &amp;amp;&amp;amp; oFile.Exists)&lt;br&gt;     {     &lt;br&gt;      bContent = oFile.OpenBinary();&lt;br&gt;      return bContent;&lt;br&gt;     }&lt;br&gt;    }&lt;br&gt;    catch&lt;br&gt;    {&lt;br&gt;     return null;&lt;br&gt;    }&lt;br&gt;   }&lt;br&gt;   return null;&lt;br&gt;  }&lt;p&gt; &lt;p&gt;&lt;br&gt;  [WebMethod]&lt;br&gt;  public bool IsExist(string strFullPath)&lt;br&gt;  {&lt;br&gt;   Microsoft.SharePoint.SPWeb oCurrentWeb = Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(this.Context);   &lt;br&gt;   Microsoft.SharePoint.SPFolder oFolder = oCurrentWeb.GetFolder(&amp;quot;DocLib/&amp;quot; + System.IO.Path.GetDirectoryName(strFullPath));&lt;br&gt;   if(oFolder != null &amp;amp;&amp;amp; oFolder.Exists)&lt;br&gt;   {&lt;br&gt;    try&lt;br&gt;    {&lt;br&gt;     Microsoft.SharePoint.SPFile oFile = oFolder.Files[System.IO.Path.GetFileName(strFullPath)];&lt;br&gt;     if(oFile != null &amp;amp;&amp;amp; oFile.Exists)&lt;br&gt;     {&lt;br&gt;      return true;&lt;br&gt;     }&lt;br&gt;    }&lt;br&gt;    catch&lt;br&gt;    {&lt;br&gt;     return false;&lt;br&gt;    }&lt;br&gt;   }&lt;br&gt;   return false;&lt;br&gt;  }&lt;p&gt; &lt;p&gt;&lt;br&gt;  private string GetFileType(string strFilePath)&lt;br&gt;  {&lt;br&gt;   string strFileExtends = System.IO.Path.GetExtension(strFilePath);&lt;br&gt;   if(strFileExtends == null || strFileExtends == string.Empty)&lt;br&gt;   {&lt;br&gt;    return DEFAULT_CONTENT_TYPE;&lt;br&gt;   }&lt;br&gt;   string strValue = null;&lt;br&gt;   try&lt;br&gt;   {&lt;br&gt;    strValue = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(strFileExtends).GetValue(&amp;quot;Content Type&amp;quot;, DEFAULT_CONTENT_TYPE) as string;&lt;br&gt;   }&lt;br&gt;   catch&lt;br&gt;   {&lt;br&gt;    strValue = DEFAULT_CONTENT_TYPE;&lt;br&gt;   }&lt;br&gt;   &lt;br&gt;   return strValue;&lt;br&gt;  }&lt;br&gt; }&lt;br&gt;}&lt;br&gt;
&lt;/pre&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3107968651015171382&amp;page=RSS%3a+%e9%99%84%e4%bb%b6%e7%ae%a1%e7%90%86web%e6%9c%8d%e5%8a%a1+%e7%bb%84%e4%bb%b6&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=ioriwellings.spaces.live.com&amp;amp;GT1=ioriwellings"&gt;</description><comments>http://ioriwellings.spaces.live.com/Blog/cns!D4DE46FA8730D2CA!1078.entry#comment</comments><guid isPermaLink="true">http://ioriwellings.spaces.live.com/Blog/cns!D4DE46FA8730D2CA!1078.entry</guid><pubDate>Wed, 23 May 2007 06:40:05 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://ioriwellings.spaces.live.com/blog/cns!D4DE46FA8730D2CA!1078/comments/feed.rss</wfw:commentRss><wfw:comment>http://ioriwellings.spaces.live.com/Blog/cns!D4DE46FA8730D2CA!1078.entry#comment</wfw:comment><dcterms:modified>2007-05-23T06:40:05Z</dcterms:modified></item><item><title>当前信任级别设置不支持调试</title><link>http://ioriwellings.spaces.live.com/Blog/cns!D4DE46FA8730D2CA!1077.entry</link><description>&lt;div&gt;星期一 天气:晴&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;由于 SharePoint 安装的过程 在iis 主目录下 建立了一个web.config 文件&lt;/div&gt;
&lt;div&gt;该文件安全设置级别比较高 导致非 SharePoint 的站点 都报 标题 这样的错误.&lt;/div&gt;
&lt;div&gt;如果删除web.config 文件 那么 sharepoint 的网站 将打不开...&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;真是搬起石头砸自己的脚.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3107968651015171382&amp;page=RSS%3a+%e5%bd%93%e5%89%8d%e4%bf%a1%e4%bb%bb%e7%ba%a7%e5%88%ab%e8%ae%be%e7%bd%ae%e4%b8%8d%e6%94%af%e6%8c%81%e8%b0%83%e8%af%95&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=ioriwellings.spaces.live.com&amp;amp;GT1=ioriwellings"&gt;</description><comments>http://ioriwellings.spaces.live.com/Blog/cns!D4DE46FA8730D2CA!1077.entry#comment</comments><guid isPermaLink="true">http://ioriwellings.spaces.live.com/Blog/cns!D4DE46FA8730D2CA!1077.entry</guid><pubDate>Mon, 21 May 2007 08:11:09 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://ioriwellings.spaces.live.com/blog/cns!D4DE46FA8730D2CA!1077/comments/feed.rss</wfw:commentRss><wfw:comment>http://ioriwellings.spaces.live.com/Blog/cns!D4DE46FA8730D2CA!1077.entry#comment</wfw:comment><dcterms:modified>2007-05-21T08:12:35Z</dcterms:modified></item></channel></rss>