5 Answers, 1 is accepted
Hi Sean,
Instead of incrementing it by one, I suggest to append current timestamp to the username which has more advantages compared to appending one. One advantage example is you can easily identify at what time the scripts failed just by seeing the id
Below is the code for appending timestamp for usernames
public string getUsername()
{
DateTime time = DateTime.Now;
string format = "dMMMdddhhmmyyyy"; // This you can change according to your need.
String username= "username_" + time.ToString(format) + DateTime.Now.Millisecond;
return username.ToLower();
}
output : username_15dectue11172015468
cs_um_18augtue06172015468
Hope this information helps you.
Regards,
Sailaja
@Sean, please try out the suggestion from Sailaja and let us know that works for you.
@Sailaja, thank you again for helping and sharing knowledge.
Thank you!
Regards,
Boyan Boev
Telerik
Hey Sailaja
This might a dumb question, but where should I put the code above?
Thanks,
Sean
You should insert the code in a coded step.
Please see this article which describes the process in details.
Let me know further assistance.
Regards,
Boyan Boev
Telerik