CKTIS / C#
System.Guid: praktična referenca
System.Guid: praktična referenca: Guid je 128-bitni identifikator z več določenimi besedilnimi predstavitvami.
Različica: .NET API; verified on .NET 10.0.14
Sintaksa
System.Guid /* select a documented member or constructor */Guid je 128-bitni identifikator z več določenimi besedilnimi predstavitvami.
Uporabite ga kot praktično enoličen identifikator, ko skrivnost in naravno časovno urejanje nista potrebna.
Guid ni skrivnost in naključni vrstni red vstavljanja lahko razdrobi indekse podatkovne baze.
Parse za neveljavno besedilo sproži FormatException, TryParse vrne false, Empty pa vsebuje same ničelne bite.
Celoten program dejansko uporabi System.Guid; natančno pričakovani stdout je 00112233445566778899aabbccddeeff.
Primeri
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using Number = System.Int32;
var id = Guid.Parse("00112233-4455-6677-8899-aabbccddeeff");
Console.WriteLine(id.ToString("N"));
Rezultat
00112233445566778899aabbccddeeff
Celoten program dejansko uporabi `System.Guid`; natančno pričakovani stdout je `00112233445566778899aabbccddeeff`.