Time of Update: 2018-12-05
今天下午研究了一下ECMAScript,暫時發現有一個好處是,如果生產生境的過程中,沒有開發環境,可以用到這個技術,因為這個有Javascript Object Client Model,暫時把一些暫時用過的執行個體及方法做一下記錄!下面的網址是Javascript Classi Library的地址,你可以從以下網址瞭解其整個架構http://msdn.microsoft.com/en-us/library/ee538253.aspx 暫時用到是SP.js,
Time of Update: 2018-12-05
以前也實現了ICompare介面的繼承,來實現兩個Object的比較,但久而久之忘記了,現在看到,想再次記錄下來,以便以後複查!下面的代碼是摘自建義亮劍一書,用來實現比較SharePoint中SPFolder的比較,其中以下代碼實現了兩種比較,一種是用Name,一種是用其另一屬性值(排序號)比較,代碼如下。說得更明白一點,就是一個用方法來Sort,一個是用繼承了ICompare類來排序。 /// <summary>/// 擷取按名稱排序後的子資料夾清單/// </
Time of Update: 2018-12-05
在用用戶端模型訪問SharePoint資料首先要添加兩個引用,一個是Microsoft.SharePoint.Client,另一個是Microsoft.SharePoint.Client.Runtime在程式要引用Microsoft.SharePoint.Client命名空間1.下面是一個簡單的例子訪問SharePoint列表的資料,讀取的是列表名稱為新聞列表,其中 ClientContext ct = new ClientContext("http://moss:84");
Time of Update: 2018-12-05
<DIV align=center><TABLE height=0 cellSpacing=0 cellPadding=0 width=996 background=pic/hnie.jpg border=0> <TBODY> <TR> <TD vAlign=bottom> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> &
Time of Update: 2018-12-05
做OA的時候,客戶需要把結果輸出成CSV檔案!CSV檔案是可以用Excel開啟,其可以換行的字型大小是斷行符號,在C#中是 \n下面是代碼把一個Table轉換成字串,一個CSV可以解析的字串!CSVConvert.aspx後台代碼 protected void Page_Load(object sender, EventArgs e) { DataTable dt = (DataTable)Session["Source"]; ConvertCSV(dt,
Time of Update: 2018-12-05
1. 一個檔案名稱為VCChartHandler.ashx,其檔案代碼為:<%@ WebHandler Language="C#" Class="VCSharePoint.BL.VCHandler,VCSharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0134fd28ed40d3b2"%> 2. 另一個類為VCHandler.cs的檔案,其後台代碼為:using System;using
Time of Update: 2018-12-05
下面是直接貼代碼: #region 獲得本文內容中的所有img標籤的圖片路徑 /// <summary> /// 獲得本文內容中的所有img標籤的圖片路徑 /// </summary> /// <param name="strHTMLContnet">HTML內容</param> /// <returns></returns>
Time of Update: 2018-12-05
網上的代碼很多,但現在大多數都是Framework 3.5的啦,對於2.0,2.5有的方法不是很相容,花了半個小時才找到一個合適,現在記錄如下:注意:不適合網路路徑,只適合本地檔案, 網路路徑請參考我另一篇Blogpublic void DownloadFile(string strFileNamePath) { long chunkSize = 102400; byte[] buffer = new byte[chunkSize];
Time of Update: 2018-12-05
public static string LogPath { get { string path = string.Empty; path = Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles) + @"\Microsoft
Time of Update: 2018-12-05
最近一段時間,項目用到了PoopleEditor控制項,下面的資料都是從網上收集過來並做一些整理 簡單的用法<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@
Time of Update: 2018-12-05
代碼如下:Page_Load方法 cblattCase.Items.Clear(); for (int i = 0; i < item.Attachments.Count; i++) { cblattCase.Items.Add(new ListItem("<a href='" + GetSPListItemAttachmentUrl(item, i) + "'
Time of Update: 2018-12-05
private void button1_Click(object sender, EventArgs e) { string webURL = "http://richsharepoint:90/ApplicationManagement"; SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site
Time of Update: 2018-12-05
1. 右鍵項目選擇屬性,再選擇“發布”選項。填好發布的地址, 安裝地址,應用程式檔案添加,一些組件的要求,更新選項,及產品的說明選項。上面的圖是發布在一個sharepoint伺服器上的,clickoncetest是一個虛擬目錄,需要在richsharepoint伺服器建立。發布檔案存放的地址是放在一個共用檔案上,以便域使用者可以訪問。2. 然後點擊安裝嚮導一步一步的填寫,直至結束。 3. 虛擬目錄的建立。 開啟IIS,
Time of Update: 2018-12-05
許多新的PowerShell 程式員可能會陷入沒有引用SharePoint PowerShell snap-in 的困境。以下代碼列舉了如何避免陷入這樣的困境。$snapin = Get-PSSnapin | where-object { $_.Name -eq'Microsoft.SharePoint.PowerShell' }if ($snapin -eq $null){write-host "Loading SharePoint PowerShell Snapin..."
Time of Update: 2018-12-05
上Application Page中的代碼 /// <summary>/// 得到上傳檔案後的檔案名稱/// </summary>/// <param name="up">FileUpload ID</param>/// <param name="s1">上傳後在庫裡的名稱</param> protected bool GetUploadName(FileUpload up, ref string s1)
Time of Update: 2018-12-05
一般來說可以產生一般的不需要使用者及密碼驗證,可以很簡單地實現功能,下面貼的代碼是對Based Windows Authentication的頁面產生PDF(我的是基於SharePoint的)代碼如下: public bool HtmlToPdf(string url, string path) { try { string filename = PdfFolder + "\\" + path +
Time of Update: 2018-12-05
閱讀Xslt教程,參考以下網址做一個執行個體http://www.w3school.com.cn/xsl/xsl_transformation.asp1. 在XML檔案加CSS <?xml-stylesheet type="text/css" href="cd_catalog.css"?>2. 在XML加Xslt檔案 <?xml-stylesheet type="text/xsl" href="testStyle.xslt"?>環境:vs2010
Time of Update: 2018-12-05
SELECT d.USER_ID as '工號',d.USER_NAME AS '姓名', c.DIATHESISCONFIG_YEAR as 'Year', case a.DIATHESIS_NAME WHEN '應變能力' THEN b.DIATHESIS_DETAILCONTENT ELSE '' END AS '應變能力', case a.DIATHESIS_NAME WHEN '學習發展' THEN b.DIATHESIS_DETAILCONTENT ELSE '' END
Time of Update: 2018-12-05
static void Main(string[] args) { // replace this string with your // Sharepoint content DB connection string string DBConnString = "Server=SP2010\\gyccp;" +
Time of Update: 2018-12-05
FileInfo file = new FileInfo(@"E:\jj.txt"); StreamReader sr = new StreamReader(@"E:\\dd.txt"); FileStream fs = new FileStream(@"E:\jj.txt", FileMode.Create); StreamWriter sw = new StreamWriter(fs,