123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
-
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace ExportStart
- {
-
-
-
- public class RevitVisionUtil
- {
-
-
-
-
-
- public static string GetRevitVision(string path)
- {
- string revitVision = null;
- FileStream stream = new FileStream(path, FileMode.Open);
- int size = 1024 * 1024;
- byte[] bytes = new byte[size];
-
- while (stream.Read(bytes, 0, size) > 0)
- {
- string str = Encoding.Unicode.GetString(bytes);
-
-
-
-
-
-
-
- string pattern = @"Autodesk Revit \d{4}";
- var match = Regex.Match(str, pattern);
- if (match.Success)
- {
- revitVision = match.Value.Substring(match.Length - 4, 4);
-
- break;
- }
- }
- return revitVision;
- }
- }
- }
|