我想将版本存储在数据库表中,不想使用varchar(max)
它。我想要固定的东西varchar(xxx)
你能告诉我,FileVersionInfo.FileVersion
Windows 平台上的最大可能长度是多少?
实际上想出了如何获得正确的版本:
var ver = FileVersionInfo.GetVersionInfo("D:\\oraociei11.dll").FileVersion;
Run Code Online (Sandbox Code Playgroud)
这将返回 Oracle 库:
OraOCIEI11.dll - 11.2.0.1.0 Production
oracore11.dll - 11.2.0.1.0 Production
oranls11.dll - 11.1.0.6.0 Production
orasnls11.dll - 11.1.0.6.0 Production
oraunls11.dll - 11.1.0.6.0 Production
oravsn11.dll - 11.2.0.2.0 Production
oracommon11.dll - 11.2.0.2.0 Production
orageneric11.dll - 11.2.0.2.0 Production
oraclient11.dll - 11.2.0.2.0 Production
orapls11.dll - 11.1.0.6.0 Production
orasql11.dll - 11.1.0.6.0 Production
oraxml11.dll - 11.1.0.6.0 Production
orahasgen11.dll - 11.2.0.1.0 Production
oraocrutl11.dll - 11.2.0.1.0 Production
oraocr11.dll - 11.2.0.1.0 Production
oraocrb11.dll - 11.2.0.1.0 Production
oranbeq11.dll - 11.2.0.2.0 Production
orantcp11.dll - 11.2.0.2.0 Production
orantcps11.dll - 11.2.0.2.0 Production
orannmp11.dll - 11.2.0.2.0 Production
orancds11.dll - 11.2.0.2.0 Production
oranldap11.dll - 11.2.0.2.0 Production
oraldapclnt11.dll - 10.1.4.0.1 Production
oraolapapi11.dll -
oranhost11.dll - 11.2.0.2.0 Production
orantns11.dll - 11.2.0.2.0 Production
oranoname11.dll -
oransgr11.dll - 11.2.0.2.0 Production
orancrypt11.dll - 11.2.0.2.0 Production
oransgr11.dll - 11.2.0.2.0 Production
oranl11.dll - 11.2.0.2.0 Production
oranro11.dll - 11.2.0.2.0 Production
oranbeq11.dll - 11.2.0.2.0 Production
orantcps11.dll - 11.2.0.2.0 Production
orannmp11.dll - 11.2.0.2.0 Production
orancds11.dll - 11.2.0.2.0 Production
oranldap11.dll - 11.2.0.2.0 Production
oraldapclnt11.dll - 10.1.4.0.1 Production
orannzsbb11.dll - 11.0.0.1.0 Production
oran11.dll - 11.2.0.2.0 Production
orannzmcs11.dll - 11.0.0.1.0 Production
oranjssl11.dll - 11.2.0.2.0 Production
oranjni11.dll - 11.2.0.2.0 Production
oranipc11.dll - 11.2.0.2.0 Production
Run Code Online (Sandbox Code Playgroud)
要以正确的方式获取文件版本:
var versionInfo = FileVersionInfo.GetVersionInfo("D:\\oraociei11.dll");
var properVersion = string.Format("{0}.{1}.{2}.{3}", versionInfo.FileMajorPart, versionInfo.FileMinorPart, versionInfo.FileBuildPart, versionInfo.FilePrivatePart);
Run Code Online (Sandbox Code Playgroud)
感谢小伙伴们的参与!
归档时间: |
|
查看次数: |
2224 次 |
最近记录: |