DataFormats.Dif Field


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Specifies the Windows Data Interchange Format (DIF), which Windows Forms does not directly use. This static field is read-only.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public static readonly string Dif

Field Value

Type: System.String

DIF is a format consisting of ASCII codes in which database, spreadsheet, and similar documents can be structured to facilitate their use by and transfer to other programs.

This field is used by the IDataObject interface and the DataObject class to specify the data type.

When adding to an IDataObject or to an implementation of DataObject, use this field as the format for the IDataObject.SetData and DataObject.SetData methods.

To see if an object of this type exists, use this field as the format for the IDataObject.GetDataPresent and DataObject.GetDataPresent methods.

To get an object of this type, use this as the format for the IDataObject.GetData and DataObject.GetData methods.

The following code example demonstrates the use of this member.

 FileStream myFileStream = File.Open("Temp.dif",FileMode.Open);
 // Store the data into Dif format.
 DataObject myDataObject = new DataObject();

// Check whether the data is stored or not in the specified format.
bool formatPresent = myDataObject.GetDataPresent(DataFormats.Dif);
    Console.WriteLine("The data has been stored in the Dif format is:'"+formatPresent+"'");
    Console.WriteLine("The data has not been stored in the specified format");

.NET Framework
Available since 1.1
Return to top