GUID不用介绍了吧。execl没有此类的生成函数,但GUID的唯一性又非常好用!自己写一个!
Private Type GUIDAPI
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Private Declare Function CoCreateGuid Lib "ole32.dll" (ByRef pguid As GUIDAPI) As Long
Public Function GUID() As String
Dim u As GUIDAPI
Call CoCreateGuid(u)
With u
GUID = Right("0000000" & Hex(.Data1), 8) & "-" & Right("000" & Hex(.Data2), 4) & "-" & Right("000" & Hex(.Data3), 4) & "-" & _
Right("0" & Hex(.Data4(0)), 2) & Right("0" & Hex(.Data4(1)), 2) & Right("0" & Hex(.Data4(2)), 2) & Right("0" & Hex(.Data4(3)), 2) & _
Right("0" & Hex(.Data4(4)), 2) & Right("0" & Hex(.Data4(5)), 2) & Right("0" & Hex(.Data4(6)), 2) & Right("0" & Hex(.Data4(7)), 2)
End With
End Function
直接拿来使用吧
2561

被折叠的 条评论
为什么被折叠?



