using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using System.Web; namespace MyProject.Features
{
public class MyEventReceiver : SPItemEventReceiver
{
HttpContext currentContext; public MyEventReceiver()
{
currentContext = HttpContext.Current;
} public override void ItemAdding(SPItemEventProperties properties)
{
if (currentContext != null)
{
if (currentContext.Request.Files.Count > 0)
{ // there are attachments }
else
{ // there are no attachments }
}
}
}
}

  我之前也以为能用item.Attachment.count去监视,后来发现这个时候都还是正在更新,并不能监视此时有没有附件。

所以用HttpContext.Current;来监视是最好的,因为它可以监视上传流。

最新文章

  1. ASP.NET Core的路由[5]:内联路由约束的检验
  2. RC上电复位时间计算
  3. SSAS:概念梳理
  4. 纯CSS最小响应网格布局
  5. 移动端页面的head头部内容
  6. 你所不知道的html5与html中的那些事第三篇
  7. PCAP 文件内容解析命令
  8. 转:CFile::Seek
  9. 移植ffmpeg到VC环境心得
  10. APIJSON-以坚持和偏执,回敬傲慢和偏见
  11. ROS学习笔记(一) : 入门之基本概念
  12. Git入门到高级系列1-git安装与基础命令
  13. C++ 使用openssl库实现 DES 加密——CBC模式 && RSA加密——公加私解——私加公解
  14. fastIO
  15. delphi 控制音量 静音的类
  16. python3 安装使用 fabirc3 模块以及 fab 命令(转)
  17. HUE的安装
  18. git ingore添加忽略文件无较的解决方法
  19. Struts2(三)配置详解
  20. 编程中检查IIS7组件的安装情况

热门文章

  1. django(6)model表语句操作、Form操作、序列化操作
  2. bzoj 5283: [CodePlus 2018 3 月赛]博弈论与概率统计
  3. 解决npm install安装慢的问题
  4. RestTemplate请求出现401错误
  5. oracle学习篇七:更新操作、事务处理
  6. TR move up && TR move down
  7. cf375D. Tree and Queries(莫队)
  8. iOS内存泄露统计
  9. Java开发高性能网站需要关注的事
  10. Oracle数据库错误消息