Freigeben über


DataFormats.Dif-Feld

Gibt das Windows-Datenaustauschformat DIF an (Data Interchange Format) an, das Windows Forms nicht direkt verwendet. Dieses static-Feld ist schreibgeschützt.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

'Declaration
Public Shared ReadOnly Dif As String
'Usage
Dim value As String

value = DataFormats.Dif
public static readonly string Dif
public:
static initonly String^ Dif
public static final String Dif
public static final var Dif : String

Hinweise

DIF ist ein aus ASCII-Code bestehendes Format, in dem Datenbanken, Kalkulationstabellen und ähnliche Dokumente strukturiert und somit von anderen Programmen verwendet bzw. an diese übertragen werden können.

Dieses Feld wird von der IDataObject-Schnittstelle und der DataObject-Klasse zum Angeben des Datentyps verwendet.

Verwenden Sie dieses Feld beim Hinzufügen zu IDataObject oder zu einer Implementierung von DataObject als Format für die IDataObject.SetData-Methode und die DataObject.SetData-Methode.

Um festzustellen, ob ein Objekt dieses Typs vorhanden ist, verwenden Sie dieses Feld als Format für die IDataObject.GetDataPresent-Methode und die DataObject.GetDataPresent-Methode.

Zum Abrufen eines Objekts dieses Typs verwenden Sie dieses Feld als Format für die IDataObject.GetData-Methode und die DataObject.GetData-Methode.

Beispiel

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
 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");
 }
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.
boolean formatPresent = myDataObject.GetDataPresent(DataFormats.Dif);
if (formatPresent) {
    Console.WriteLine(
        "The data has been stored in the Dif format is:'" 
        + System.Convert.ToString(formatPresent) + "'");
}
else {
    Console.WriteLine("The data has not been stored in the "
        + "specified format");
}

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

DataFormats-Klasse
DataFormats-Member
System.Windows.Forms-Namespace
GetData
SetData
GetDataPresent
GetFormats
DataObject
IDataObject
GetFormat
DataFormats.Format.Name
DataFormats.Format.Id