代码如下:
JScript
function GenerateGuid() {
var TypeLib = new ActiveXObject("Scriptlet.TypeLib");
return (TypeLib.Guid);
}
VBScript
Function GenerateGuid()
Dim TypeLib
Set TypeLib = Server.CreateObject("Scriptlet.TypeLib")
GenerateGuid = TypeLib.Guid
End Function
如果要在客户端使用的话,VBScript的代码需要稍做修改,即把:
Set TypeLib = Server.CreateObject("Scriptlet.TypeLib")
修改为:
Set TypeLib = CreateObject("Scriptlet.TypeLib")
但是在客户端使用ActiveX的时候,IE默认的
安全设置会提示是否允许使用ActiveX,所以并不推荐使用。
文章评论
共有 位脚本之家网友发表了评论我来说两句