January 1, 2005

WinTask - GetGUID

'
' GetGUID - Get a GUID (from the http://www.guidgen.com/Index.aspx site)
'
' Author: Joe Strazzere
'

Function GetGUID$()
  Local TempFile$
  Local Var$

  TempFile$="c:jsstemp.txt"

  If Exist(TempFile$) then
      Kill(TempFile$)
  End If

  External("urlmon.dll", "URLDownloadToFileA", 0, "http://www.guidgen.com/Index.aspx", TempFile$, 0, 0)

  SetReadPos(TempFile$,0)
  Read(TempFile$, Var$)

  GetGUID$=ExtractBetween$(Var$,"class="+Chr$(34)+"yourguid"+Chr$(34)+">",excluded,"</span>",excluded)

EndFunction

 

MsgBox(GetGUID$())