小编Gri*_*911的帖子

在C#中设置int时,逗号运算符/分隔符的机制是什么?

我正在分析此stackoverflow问题的接受答案中的代码示例,其中包含以下代码块:

public static void SplitFile(string inputFile, int chunkSize, string path)
{
    const int BUFFER_SIZE = 20 * 1024;
    byte[] buffer = new byte[BUFFER_SIZE];

    using (Stream input = File.OpenRead(inputFile))
    {
        int index = 0;
        while (input.Position < input.Length)
        {
            using (Stream output = File.Create(path + "\\" + index))
            {
                int remaining = chunkSize, bytesRead;
                while (remaining > 0 && (bytesRead = input.Read(buffer, 0,
                        Math.Min(remaining, BUFFER_SIZE))) > 0)
                {
                    output.Write(buffer, 0, bytesRead);
                    remaining -= bytesRead;
                }
            }
            index++;
            Thread.Sleep(500); // …
Run Code Online (Sandbox Code Playgroud)

c# operators comma

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

标签 统计

c# ×1

comma ×1

operators ×1