UniqueId.CreateRandomId Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CreateRandomId() |
Creates a unique, random ID suitable for use in an xml:id field. The value is hard to guess and unique. |
CreateRandomId(String) |
Creates a unique, random ID similar to that created by CreateRandomId, but instead of an underscore, the supplied prefix is used. |
CreateRandomId()
Creates a unique, random ID suitable for use in an xml:id field. The value is hard to guess and unique.
public static string CreateRandomId ();
static member CreateRandomId : unit -> string
Public Shared Function CreateRandomId () As String
Returns
The unique ID.
Applies to
CreateRandomId(String)
Creates a unique, random ID similar to that created by CreateRandomId, but instead of an underscore, the supplied prefix is used.
public static string CreateRandomId (string prefix);
static member CreateRandomId : string -> string
Public Shared Function CreateRandomId (prefix As String) As String
Parameters
- prefix
- String
The prefix to use.
Returns
The random URI.