Exemplo n.º 1
0
    private string ShowWarn()
    {
        int        num        = 0;
        int        num2       = 0;
        string     text       = "";
        MailManage mailManage = new MailManage();
        DataTable  userSet    = mailManage.GetUserSet(this._strSenderCode);

        if (userSet.Rows.Count > 0)
        {
            num  = int.Parse(userSet.Rows[0]["i_MailNumber"].ToString());
            num2 = int.Parse(userSet.Rows[0]["i_DiskSpace"].ToString());
        }
        int mailNumber = mailManage.GetMailNumber(this._strSenderCode);
        int diskSpace  = mailManage.GetDiskSpace(this._strSenderCode);

        if (num < mailNumber || num2 < diskSpace)
        {
            text = "<FONT color=\"#FF0000\"><B>警告:</B></FONT>";
            string text2 = text;
            text = string.Concat(new string[]
            {
                text2,
                "你的邮箱中有",
                mailNumber.ToString(),
                "/",
                num.ToString(),
                "封邮件,"
            });
            string text3 = text;
            text = string.Concat(new string[]
            {
                text3,
                "磁盘空间占用",
                (Convert.ToSingle(diskSpace) / 1048576f).ToString("0.00"),
                "/",
                (num2 / 1048576).ToString("0.00"),
                "MB,"
            });
            if (num < mailNumber && num2 < diskSpace)
            {
                text += "<FONT color=\"#FF0000\"><B>邮件数量和磁盘空间</B></FONT>都超出设置,请清理邮箱,不然暂存区的邮件将无法收取!";
            }
            else
            {
                if (num < mailNumber)
                {
                    text += "<FONT color=\"#FF0000\"><B>邮件数量</B></FONT>超出设置,请清理邮箱!";
                }
                else
                {
                    text += "<FONT color=\"#FF0000\"><B>磁盘空间</B></FONT>超出设置,请清理邮箱!";
                }
            }
        }
        return(text);
    }