我正在使用Web服务将文档上载到Sharepoint的网站上工作.我有一个工作的Web服务并上传到Sharepoint.但是,我需要从正在上传的文件中添加元数据,例如来自数据库记录的名字,姓氏,出生日期等,以及来自该站点的实时数据.这些数据类似于"工作流程编号","协议编号","文档类型",它在网站上生成并与该成员和文档相关联.
这是代码:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using Microsoft.SharePoint.Client;
namespace DCTMAgent
{
public class SharePoint
{
internal void SPUploader(Stream fs, string fn)
{
ClientContext context = new ClientContext("http://SharepointSite/Home.aspx");
System.Net.ICredentials creds = System.Net.CredentialCache.DefaultCredentials;
context.Credentials = creds;
context.RequestTimeout = 60000000; // Time in milliseconds
string url = "/Members/";
string fileName = Path.GetFileName(fn);
string fnUrl = url + fn;
Microsoft.SharePoint.Client.File.SaveBinaryDirect(context, fnUrl, fs, true);
}
}
}
Run Code Online (Sandbox Code Playgroud)
如何向正在上传的文件添加元数据?
我有一个包含250个帐户的Excel电子表格,每个帐户都有一堆交易记录.我需要提取利率变化的日期.有250000多条记录.
它看起来像这样:
ACCT CEL-INT-RATE LTD-INT-BILL FileDate
0006365290140074793 84.00 1479.43 20131007
0006365290140074793 84.00 1479.43 20131012
0006365290140074793 84.00 1479.43 20131014
0006365290140074793 84.00 2598.55 20131107 <---
0006365290140074793 21.00 2598.55 20131111
0006365290140074793 21.00 2598.55 20131129
0006365290140074793 21.00 2598.55 20131204
Run Code Online (Sandbox Code Playgroud)
我需要日期'20131107',我用<---标记,其中利率最后为84.00,然后更改为21.00,对于该帐户0006365290140074793
任何人都可以帮助这个公式.
提前致谢
我正在使用ASP.NET MVC5 Identity并尝试实现基于声明的身份验证.
我收到以下错误:
无法隐式转换类型'System.Collections.Generic.IEnumerable << anonymous type:string subject,string type,string value >>'to System.Web.Mvc.ActionResult'.存在显式转换(您是否错过了演员?)
这是一段代码:
public ActionResult GetClaims()
{
var identity = User.Identity as ClaimsIdentity;
var claims = from c in identity.Claims
select new
{
subject = c.Subject.Name,
type = c.Type,
value = c.Value
};
return claims;
}
Run Code Online (Sandbox Code Playgroud)
我正在关注http://bitoftech.net/2015/03/31/asp-net-web-api-claims-authorization-with-asp-net-identity-2-1/的一个例子
asp.net ×1
asp.net-mvc ×1
c# ×1
excel ×1
metadata ×1
sharepoint ×1
spreadsheet ×1
web-services ×1