DataFormats.Dif フィールド

定義

Windows DIF (Data Interchange Format) を指定します。Windows フォームでは、この形式が直接使用されることはありません。 static フィールドは読み取り専用です。

public: static initonly System::String ^ Dif;
public static readonly string Dif;
 staticval mutable Dif : string
Public Shared ReadOnly Dif As String 

フィールド値

次のコード例では、このメンバーの使用方法を示します。

FileStream^ myFileStream = File::Open( "Temp.dif", FileMode::Open );

// Store the data into Dif format.
DataObject^ myDataObject = gcnew DataObject;
myDataObject->SetData( DataFormats::Dif, myFileStream );

// Check whether the data is stored or not in the specified format.
bool formatPresent = myDataObject->GetDataPresent( DataFormats::Dif );
if ( formatPresent )
{
   Console::WriteLine( "The data has been stored in the Dif format is:'{0}'", formatPresent );
}
else
{
   Console::WriteLine( "The data has not been stored in the specified format" );
}
 FileStream myFileStream = File.Open("Temp.dif",FileMode.Open);
 // Store the data into Dif format.
 DataObject myDataObject = new DataObject();
 myDataObject.SetData(DataFormats.Dif,myFileStream);

// Check whether the data is stored or not in the specified format.
bool formatPresent = myDataObject.GetDataPresent(DataFormats.Dif);
 if(formatPresent) 
 {
    Console.WriteLine("The data has been stored in the Dif format is:'"+formatPresent+"'");
 } 
 else 
 {
    Console.WriteLine("The data has not been stored in the specified format");
 }
Dim myFileStream As FileStream = File.Open("Temp.dif", FileMode.Open)
' Store the data into Dif format.
Dim myDataObject As New DataObject()
myDataObject.SetData(DataFormats.Dif, myFileStream)

' Check whether the data is stored or not in the specified format.
Dim formatPresent As Boolean = myDataObject.GetDataPresent(DataFormats.Dif)
If formatPresent Then
   Console.WriteLine(("The data has been stored in the Dif format is:'" + formatPresent.ToString() + "'"))
Else
   Console.WriteLine("The data has not been stored in the specified format")
End If

注釈

DIF は ASCII コードで構成される形式で、データベース、スプレッドシート、および同様のドキュメントを構造化して、他のプログラムでの使用や他のプログラムへの転送を容易にすることができます。

このフィールドは、インターフェイスと DataObject クラスによってIDataObject使用され、データ型を指定します。

または を IDataObjectDataObject実装に追加する場合は、 メソッドと DataObject.SetData メソッドの形式としてこのフィールドをIDataObject.SetData使用します。

この型のオブジェクトが存在するかどうかを確認するには、 メソッドと DataObject.GetDataPresent メソッドの形式としてこのフィールドをIDataObject.GetDataPresent使用します。

この型のオブジェクトを取得するには、 メソッドと DataObject.GetData メソッドの形式IDataObject.GetDataとしてこれを使用します。

適用対象

こちらもご覧ください