FromBase64String的写法

要求字符串长度必须是4的偶数倍,最好带上错误处理

                Try
                    Me.data = System.Convert.FromBase64String(buffer.Substring(start, 8 * (buffer.Substring(start).Length / 8)))
                Catch exp As System.ArgumentNullException
                    System.Console.WriteLine("Base 64 string is null.")
                    Return
                Catch exp As System.FormatException
                    System.Console.WriteLine("Base 64 length is not 4 or is " + _
                                             "not an even multiple of 4.")
                    Return
                End Try

你可能感兴趣的:(VB.Net学习笔记)