小编dap*_*der的帖子

c#2.0中不允许使用默认参数说明符错误

我在我的程序的代码块中收到此错误.我正在使用c#和.net 2.0.它在代码的第一行中以十进制= 2显示此错误.请帮忙

 private string formatSizeBinary(Int64 size, Int32 decimals = 2)
    {
        string[] sizes = { "Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
        double formattedSize = size;
        Int32 sizeIndex = 0;
        while (formattedSize >= 1024 & sizeIndex < sizes.Length)
        {
            formattedSize /= 1024;
            sizeIndex += 1;
        }
        return string.Format("{0} {1}", Math.Round(formattedSize, decimals).ToString(), sizes[sizeIndex]);
    }
Run Code Online (Sandbox Code Playgroud)

c# c#-2.0

1
推荐指数
1
解决办法
899
查看次数

没有为一个或多个必需参数提供视觉基本错误的值

此错误出现在vb代码的以下行中

 rs.Open "select * From Reservation where [table_number]=tablenumber.text and booking_date=bookingdate.Text", cn, adOpenStatic, adLockPessimistic
Run Code Online (Sandbox Code Playgroud)

vb6 vba

1
推荐指数
1
解决办法
3万
查看次数

标签 统计

c# ×1

c#-2.0 ×1

vb6 ×1

vba ×1