ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby (https://forum.antichat.xyz/forumdisplay.php?f=24)
-   -   C# WPF (https://forum.antichat.xyz/showthread.php?t=768539)

WoS 23.05.2017 14:30

Помогите исправить ошибку

Кусок кода

Код:


Код:

public static UpdateFile FromString(string line)
        {
            if (line == null)
                throw new ArgumentNullException("line");

            if (line.StartsWith(" "))
                line = line.TrimStart();

            if (line.EndsWith(" "))
                line = line.TrimEnd();

            string[] segments = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            if (segments == null || segments.Length != 3)
            {
                throw new FormatException("Переданная строка имеет неверный формат");
            }

            long fileSize = long.Parse(segments[2]);
            return new UpdateFile(segments[0], segments[1], fileSize);
        }

Ошибка

- segments {string[0x00000005]} string[]

[0] "WoS_Data\\Resources\\unity" string

[1] "default" string

[2] "resources" string

[3] "d68e48d272af1ced2f8a8439f59f188c" string

[4] "729028" string

segments.Length 0x00000005 int


Время: 13:37