次の方法で共有


DiscoveryDocument.CanRead メソッド

渡された XmlReaderDiscoveryDocument に逆シリアル化できるかどうかを示す値を返します。

Public Shared Function CanRead( _
   ByVal xmlReader As XmlReader _) As Boolean
[C#]
public static bool CanRead(XmlReaderxmlReader);
[C++]
public: static bool CanRead(XmlReader* xmlReader);
[JScript]
public static function CanRead(
   xmlReader : XmlReader) : Boolean;

パラメータ

戻り値

XmlReaderDiscoveryDocument に逆シリアル化できる場合は true 。それ以外の場合は false

使用例

[Visual Basic, C#, C++] CanRead プロパティが true の場合の、探索ドキュメントの内容を読み込むコード例を次に示します。

 
' Check whether the given XmlTextReader is readable.
If DiscoveryDocument.CanRead(myXmlTextReader) = True Then
   ' Read the given XmlTextReader.
   myDiscoveryDocument = DiscoveryDocument.Read(myXmlTextReader)
Else
   Console.WriteLine("The supplied file is not readable")
End If

[C#] 
// Check whether the given XmlTextReader is readable.
if( DiscoveryDocument.CanRead( myXmlTextReader ) == true )
{
   // Read the given XmlTextReader.
   myDiscoveryDocument = DiscoveryDocument.Read( myXmlTextReader );
}
else
{
   Console.WriteLine( "The supplied file is not readable" );
}

[C++] 
// Check whether the given XmlTextReader is readable.
if (DiscoveryDocument::CanRead(myXmlTextReader) == true)
   // Read the given XmlTextReader.
   myDiscoveryDocument = DiscoveryDocument::Read(myXmlTextReader);
else
   Console::WriteLine(S"The supplied file is not readable");

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

DiscoveryDocument クラス | DiscoveryDocument メンバ | System.Web.Services.Discovery 名前空間 | XmlReader