PDA

Click to See Complete Forum and Search --> : What's a guid?


jakkjakk
Mar 11th, 2009, 12:29 AM
Anyone know what a guid structure is? When its defined like this:

Private hdrGUID As Guid = New Guid("75B22630-668E-11CF-A6D9-00AA0062CE6C")

jmcilhinney
Mar 11th, 2009, 01:20 AM
Anyone know what MSDN is?

http://msdn.microsoft.com/en-us/library/system.guid.aspx

The idea of a GUID is that you can generate such a value on a single system and then use that as an ID across multiple systems because the likelihood of another system generating the same value is negligible.

jakkjakk
Mar 13th, 2009, 03:26 AM
What I was hoping for Jc was for someone to have an example of it that I could actually follow. Like what exactly is the
"75B22630-668E-11CF-A6D9-00AA0062CE6C"?
Now I'm assuming that's the unique identifier but how do you use that?

I'm actually trying to parse .wma files and get the meta data out of them. They use these guid structures.

Hack
Mar 13th, 2009, 05:44 AM
Moved To General Developer

mendhak
Mar 13th, 2009, 05:54 AM
Did anyone else read that as "What's a quid?" ? :D

You would generally use a GUID when you need a unique string to represent 'something' in your application. Its applications are... limitless. As an example, I wrote a file service that accepts files and stores it... a content delivery system, if you will.

Thing is, I can't store the file to disk as is. So each file name needs to be unique. Two people could upload the same file name. I could append the current datetime but that doesn't stop two people from uploading "resume.doc" at the same time. For that purpose, there's the GUID - it's a generated string which is thought to be sufficiently unique in its range to be considered truly random and unique.

Because there are 2128 possible combinations, you can let your application believe that the string generated will be unique.

In and of itself,

75B22630-668E-11CF-A6D9-00AA0062CE6C

means nothing. It is just a reference, or a key, to a certain piece of data you may have stored somewhere.

dilettante
Mar 18th, 2009, 08:16 AM
GUIDs/UUIDs are just "unique" values.

Think of them as something like a database table's Counter/AutoNumber ID field primary key, or Enum values, etc. Each one simply stands in for something else, sometimes conceptual.

Like an Enum value, each one is assigned a "meaning" someplace else. Usually in some purpose-oriented directory. XML namespaces use URIs in much the same way.

You'd need to find the appropriate dictionary of WMA GUIDs and their meanings.


It's like the old bit about some guys stranded on an island for years who have told every joke everyone knows time after time. So now every so often somebody just calls out "37!" and everyone chuckles just a little bit.