Format:
Recent snippets matching tags of Guid
//Stored Guid as a string string strGuid = "5152A989-279F-4A81-AC68-4696966CD1E2" //Creating a GUID obj based on that guid string new Guid(strGuid);
77 Views
no comments
string strFormatedGuid = Guid.NewGuid().ToString("N"); //Where N is the format, can be any of the ones described below /* Format: N Output 32 digits: 00000000000000000000000000000000 Format: D Output 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000
70 Views
no comments
Imports System.Text.RegularExpressions Module Module1 'http://learn.open.ac.uk/mod/oublog/viewpost.php?post=23031 'www.ForkandBeard.co.uk Sub Main() Dim strUserNumbers As String() strUserNumbers = New String() { _
413 Views
no comments
Imports System.Text.RegularExpressions Module Module1 Sub Main() Dim strUserNumbers As String() strUserNumbers = New String() { _ "H0W_BOvThemy84kies" _ , "01543 MWC66" _ , "8" _
279 Views
no comments
using System; using System.Runtime.InteropServices; /// <summary> /// Class that encapsulates the Win32 function CLSIDFromString. Idea taken from /// http://stackoverflow.com/questions/104850/c-test-if-string-is-a-guid-without-throwing-exceptions/287877#287877 /// </summary> public static class GuidHelper {
354 Views
no comments
/// <summary> /// Generates a unique Id as string /// </summary> /// <returns></returns> public static string GenerateUniqueId() { byte[] bytes = Guid.NewGuid().ToByteArray(); return StringUtils.Base36Encode(BitConverter.ToInt64(bytes, 0)); }
245 Views
no comments
List<long> list = new List<long>(); byte[] bytes = Guid.NewGuid().ToByteArray(); long val = BitConverter.ToInt64(bytes,0); val.Dump(); val.ToString("x").Dump(); val.ToString("x").Length.Dump(); for(int i=0; i<1000000; i++) {
197 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
