NegotiateStream.Length プロパティ
アセンブリ: System (system.dll 内)



このプロパティは、基になるストリームの Length プロパティを呼び出すことによって取得される値を返します。基になるストリームがシーク可能ではない場合、このメソッドは通常、例外をスローします。基になるストリームのランタイム型によって、スローされる例外のランタイム型が決まります。

このプロパティの値を表示する方法については、次のコード例を参照してください。
static void DisplayStreamProperties(NegotiateStream stream) { Console.WriteLine("Can read: {0}", stream.CanRead); Console.WriteLine("Can write: {0}", stream.CanWrite); Console.WriteLine("Can seek: {0}", stream.CanSeek); try { // If the underlying stream supports it, display the length. Console.WriteLine("Length: {0}", stream.Length); } catch (NotSupportedException) { Console.WriteLine("Cannot get the length of the underlying stream."); } if (stream.CanTimeout) { Console.WriteLine("Read time-out: {0}", stream.ReadTimeout); Console.WriteLine("Write time-out: {0}", stream.WriteTimeout); } }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- NegotiateStream.Length プロパティのページへのリンク