CogSerializer LoadObjectFromFile Method (String, Type)Cognex VisionPro 9.22
Loads an object from a file in the specified format.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 87.0.0.0
Syntax

public static Object LoadObjectFromFile(
	string path,
	Type formatterType
)

Parameters

path
Type: System String
The path to the input file.
formatterType
Type: System Type
The type of formatter to use. Use a BinaryFormatter to save the object as binary data. For example, to use the BinaryFormatter in C# you would type: typeof(System.Runtime.Serialization.Formatters.Binary.BinaryFormatter)

Return Value

Type: Object
The loaded object.
Remarks

To learn more about persisting objects, see Persistence in VisionPro
See Also