检测 C# .NET 中 3D 文件的格式
Contents
[
Hide
]
使用 Aspose.3D for .NET API,开发人员可能会在打开 C# 中受支持的 3D 文件的格式之前检测到它,因为文件扩展名不能保证文件内容是适当的。
检测格式编程示例
以下 C# 示例代码说明如何检测 3D 文件的文件格式 (使用文件路径或流) 并检查其扩展名。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
// Detect the format of a 3D file | |
FileFormat inputFormat = FileFormat.Detect("document.fbx"); | |
// Display the file format | |
Console.WriteLine("File Format: " + inputFormat.ToString()); |