Exemplo n.º 1
0
        /// <summary>向页面输出js提示</summary>
        /// <param name="errorNumber"></param>
        /// <param name="customMsg"></param>
        private void SendResponse(int errorNumber, string customMsg)
        {
            _errMsg = customMsg;

            switch (errorNumber)
            {
            case 101:
                return;

            case 201:
                _errMsg = "请选择要上传的文件!";
                return;

            case 202:
                _errMsg = "不支持该文件格式,只支持以下格式:(" + this.AllowedExt + ").";
                return;

            case 203:
                _errMsg = "系统禁止上传格式:(" + this.DeniedExt + ").";
                return;

            case 204:
                _errMsg = "权限出错. 您可能没有权限上传文件. 请检查服务器.";
                return;

            case 301:
                _errMsg = "上传文件大小超过了限制.最多上传(" + DirFileHelper.FmtFileSize2(_maxSize) + ").";
                return;

            case 500:
                _errMsg = "系统暂时禁止上传文件.";
                return;

            case 501:
                _errMsg = "非法提交!!";
                return;

            case 502:
                _errMsg = "参数错误!!key";
                return;

            case 503:
                _errMsg = "参数错误!!subid";
                return;

            default:
                _errMsg = "不知名的错误!.";
                return;
            }
        }