1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-09 15:12:26 +08:00

增加GetExeDllVersion函数获取exe,dll版本号

This commit is contained in:
guanren
2024-10-18 00:00:18 +08:00
parent 213e2b4ead
commit a74462941e
5 changed files with 74 additions and 4 deletions

View File

@@ -1076,4 +1076,34 @@ func main() {
// Jim,21,male
// 2
}
```
### <span id="Version">GetExeDllVersion</span>
<p>返回exe,dll文件版本号(仅Window平台).</p>
<b>函数签名:</b>
```go
func GetExeDllVersion(filePath string) (string, error)
```
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/s_Tl7lZoAaY)</span></b>
```go
package main
import (
"fmt"
"github.com/duke-git/lancet/v2/fileutil"
)
func main() {
v, err := fileutil.GetExeDllVersion(`C:\Program Files\Tencent\WeChat\WeChat.exe`)
if err != nil {
panic(err)
}
fmt.Println(v)
// Output:
// 3.9.10.19
}
```