Sharepoint 2007 Sharepoint附件删除文件名

Sharepoint 2007 Sharepoint附件删除文件名,sharepoint-2007,Sharepoint 2007,如何查找要删除的附件文件名 ItemAttachmentDeleted、ItemAttachmentDeleteing events afterproperties和beforeproperties都是空的下面的代码为我们提供了第一个附件名称 SPFile attachment = properties.ListItem.ParentList.RootFolder. SubFolders["Attachments"].SubFolders[properties.ListItemId.

如何查找要删除的附件文件名


ItemAttachmentDeleted、ItemAttachmentDeleteing events afterproperties和beforeproperties都是空的

下面的代码为我们提供了第一个附件名称

SPFile attachment = properties.ListItem.ParentList.RootFolder.
      SubFolders["Attachments"].SubFolders[properties.ListItemId.ToString()].
      Files[properties.ListItem.Attachments.Count - 1];    

string link =  attachment.Name ;

下面的代码为我们提供了第一个附件名称

SPFile attachment = properties.ListItem.ParentList.RootFolder.
      SubFolders["Attachments"].SubFolders[properties.ListItemId.ToString()].
      Files[properties.ListItem.Attachments.Count - 1];    

string link =  attachment.Name ;
使用

使用