www.cftea.com

没有选择文件时,Request.Files.Count 值是多少?

ITPOW2019/7/19 15:20:42

在 ASP.NET 中,如果有文件上传框,且 enctypemultipart/form-data。那么:

Request.Files.Count 永远 >= 1,即使没有选择文件也是。

Request.Files[0].ContentLength 永远 >= 0,即使没有选择文件,Request.Files[0] 也不会为 null

<<返回首页<<