C# 使用C访问Sharepoint文件和文件类型#
我目前正在修改现有的c#,并试图在上传文件时识别文件类型。以下C# 使用C访问Sharepoint文件和文件类型#,c#,sharepoint,C#,Sharepoint,我目前正在修改现有的c#,并试图在上传文件时识别文件类型。以下 public override void ItemAdded(SPItemEventProperties properties) { commentscheck(properties); } 从该函数调用的commentscheck函数正在尝试验证文件类型 我想知道是否可以从SPItemEventProperties访问一些内容,这些内容可以告诉我已上载的文件类型?检查properties.
public override void ItemAdded(SPItemEventProperties properties)
{
commentscheck(properties);
}
从该函数调用的commentscheck函数正在尝试验证文件类型
我想知道是否可以从SPItemEventProperties访问一些内容,这些内容可以告诉我已上载的文件类型?检查properties.AfterUrl并将其拆分
public override void ItemAdded(SPItemEventProperties properties)
{
string[] FileTypeParts = properties.AfterUrl.Split(".");
string fileType = FileTypeParts [FileTypeParts .length-1];
string FileNameParts = properties.AfterUrl.Split("/");
string FileName = FileNameParts [FileNameParts .length-1];
commentscheck(properties);
}