(开发篇) 名称验证~ 检测FileUpload上传的空间名称

<asp:FileUpload ID="addFileUpload" runat="server" />

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="addFileUpload" 

 ErrorMessage="必须是 jpg或者gif文件" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF)$">

</asp:RegularExpressionValidator>

 

你可能感兴趣的:(fileupload)