1
如何找到這是越來越刪除的Sharepoint附件刪除文件名
兩個ItemAttachmentDeleted附件的文件名,ItemAttachmentDeleting事件afterproperties和beforeproperties是空
如何找到這是越來越刪除的Sharepoint附件刪除文件名
兩個ItemAttachmentDeleted附件的文件名,ItemAttachmentDeleting事件afterproperties和beforeproperties是空
下面的代碼給了我們第一個附件名稱
SPFile attachment = properties.ListItem.ParentList.RootFolder.
SubFolders["Attachments"].SubFolders[properties.ListItemId.ToString()].
Files[properties.ListItem.Attachments.Count - 1];
string link = attachment.Name ;
使用
string beforeUrl = properties.BeforeUrl;
string[] fileName = beforeUrl.Split('/');
string deletedfile = fileName[fileName.Length - 1];