前端之家收集整理的这篇文章主要介绍了
vb6生成GUID,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
PrivateDeclareFunctionCoCreateGuidLib"ole32"(idAsAny)AsLong PrivateSubForm_Load() Msg
Box"GeneratedGUID:"+CreateGUID EndSub PublicFunctionCreateGUID()AsString Dimid(0To15)AsByte DimCntAsLong,GUIDAsString IfCoCreateGuid(id(0))=0Then ForCnt=0To15 CreateGUID=CreateGUID+IIf(id(Cnt)<16,"0","")+Hex$(id(Cnt)) NextCnt CreateGUID=Left$(CreateGUID,8)+"-"+Mid$(CreateGUID,9,4)+"-"+Mid$(CreateGUID,13,17,4)+"-"+Right$(CreateGUID,12) Else Msg
Box"ErrorwhilecreatingGUID!" EndIf EndFunction
原文链接:https://www.f2er.com/vb/259214.html