Skip To Main Content | Home | Sitemap | Contact
Latest Visitors: United States's flagUnited States's flagUnited States's flagRussian Federation's flagChina's flagChina's flagUnited States's flagBrazil's flagIreland's flagIndia's flagUnited States's flagUnited Kingdom's flagGermany's flagUnited States's flagCanada's flagCanada's flagUnited States's flagBrazil's flagSweden's flagUnited States's flagUnited States's flagUnited Kingdom's flagUnited States's flagItaly's flagUnited Kingdom's flag
 

How can you create a GUID?

This example leverages internal Window's functionality to obtain a GUID.  Obviously this is useful only on IIS. Refresh the page to obtain a new GUID.

What is a GUID? Excerpt from Wikipedia: "A globally unique identifier or GUID is a special type of identifier used in software applications to provide a reference number which is unique in any context (hence, "globally"), for example, in defining the internal reference for a type of access point in a software application, or for creating unique keys in a database. While each generated GUID is not guaranteed to be unique, the total number of unique keys (2128 or 3.4×1038) is so large that the probability of the same number being generated twice is extremely small."

GUIDs are useful in creating anti-CSRF tokens for web applications.  Generate A GUID Using PHP  A Pseudo Unique ID Using ASP

GUID: {A70E2F46-FEC9-4045-A3E0-66A873E70FD9}


Function getGUID
    Dim TypeLib, tg
    On Error Resume Next
    Set TypeLib = Server.CreateObject("Scriptlet.TypeLib")
    If Err Then
        Response.Write "GP ERROR 1"
        Response.Write err.number & " " & err.description & " " & err.source
        Response.End
    Else
        tg = TypeLib.Guid
        getGUID = CStr(Left(tg, Len(tg)-2))
        Set TypeLib = Nothing
    End If
    On Error Goto 0
End Function

Simple Use: Response.Write getGUID
  


This Weeks Most Popular Pages Newest Pages