自动生成字母数字 [英] Automatically generate Alphanumeric

查看:87
本文介绍了自动生成字母数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有两列,分别是id(varchar (16))password (char(10)).现在,我想调用用于自动生成字母数字的方法,该方法应该保存在mysql中.

问候
Asha

Hi,

I have two column that is id(varchar (16)) and password (char(10)). Now I want to call method for generating alphanumeric automatically and that should save in mysql..

Regards
Asha

推荐答案

您可以尝试
You could try the Membership.GeneratePassword[^] method.

Or
Guid.NewGuid().ToString()


...用随机的String得出结论:

...to get to the point with the random String:

public String getRandom(int iLength) {
    UUID oID = UUID.randomUUID();
    String strRandom = oID.toString()
    return strRandom.substring(iLength);
}



返回所需长度的随机String.



returns a random String in a desired length.


这篇关于自动生成字母数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆