unique id c#
public string generateID()
{
return Guid.NewGuid().ToString("N");
}
unique id c#
public string generateID()
{
return Guid.NewGuid().ToString("N");
}
how to generate random unique id in c#
public Random a = new Random(); // replace from new Random(DateTime.Now.Ticks.GetHashCode());
// Since similar code is done in default constructor internally
public List<int> randomList = new List<int>();
int MyNumber = 0;
private void NewNumber()
{
MyNumber = a.Next(0, 10);
while(randomList.Contains(MyNumber))
MyNumber = a.Next(0, 10);
}
unique id c#
public string generateID(string sourceUrl)
{
return string.Format("{0}_{1:N}", sourceUrl, Guid.NewGuid());
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us