随机生成N个字符(包含数字和字母)
'*************************************************************
' Name: GetRandomString
' Purpose: 随机生成N个字符(包含数字和字母)
' Parameters:
'strGet -output string
' *************************************************************
Function GetRandomString(strGet,iSize)
' TODO: add function body here
strGet=""
Randomize
For j=1 to iSize
i=RandomNumber(0,1)
If i=0 Then
strGet=strGet & Chr(Int(Rnd()*10)+48)
Elseif i=1 then
strGet=strGet & Chr(Int(Rnd()*26)+65)
' Else
' strGet=strGet & Chr(Int(Rnd()*26)+97)
End If
Next
End Function
'调用GetRandomString函数,可组合形成:固定字符+随机字符
Function GetVehicleNo(strVehicleNo)
GetRandomString strGet,5
strVehicleNo=strVehicleNo & strGet
GetVehicleNo=strVehicleNo
End Function
随机生成N个字符(包含数字和字母)的更多相关文章
- python 几种方法实现随机生成8位同时包含数字、大写字符、小写字符密码的小程序
python 实现随机生成包8位包含大写字母.小写字母和数字的密码的程序.要求:1用户输入多少次就生成多少条密码,2要求密码必须同时包含大写字母.小写字母和数字,长度8位,不能重复代码如下: impo ...
- C# 批量生成随机密码,必须包含数字和字母,并用加密算法加密
要求:密码必须包含数字和字母 思路:1.列出数字和字符. 组成字符串 :chars 2.利用randrom.Next(int i)返回一个小于所指定最大值的非负随机数. 3. 随机取不小于chars长 ...
- .net 反射访问私有变量和私有方法 如何创建C# Closure ? C# 批量生成随机密码,必须包含数字和字母,并用加密算法加密 C#中的foreach和yield 数组为什么可以使用linq查询 C#中的 具名参数 和 可选参数 显示实现接口 异步CTP(Async CTP)为什么那样工作? C#多线程基础,适合新手了解 C#加快Bitmap的访问速度 C#实现对图片文件的压
以下为本次实践代码: using System; using System.Collections.Generic; using System.ComponentModel; using System ...
- java生成四位随机数,包含数字和字母 区分大小写,特别适合做验证码,android开发
private String generateWord() { String[] beforeShuffle = new String[] { "2", "3" ...
- QTP_随机生成N个字符(包含数字和字母)
'************************************************************* ' Name: GetRandomString ' Purpose: 随机 ...
- js随机生成[n,m)的数字(不包括m)
Math.random();//随机生成0到1的数字 Math.floor();//取小整 Math.floor(Math.random()*(最大值 - 最小值) + 最小值) 生成2到8的数:Ma ...
- 随机生成指定长度字符字符串(C语言实现)
相关函数 srand(), rand()头文件#include<stdlib.h> 定义函数 int rand(void) 函数说明 rand()会返回一随机数值,范围在0至RAND_MA ...
- python 查找字符串同时包含数字和字母的最长子字符串的几种实现方法
有个字符串$sd1#111$svda123!!!221&eSSDSDG,包含特殊字符.数字和字母,输出最长的子字符串和他的长度 例如上面的字符串同时包含数字和字母的字符串是svda123,长度 ...
- Python求包含数字或字母最长的字符串及长度
一.求包含数字或字母最长的字符串及长度 org = 'ss121*2222&sdfs2!aaabb' result = [] #保存最终要输出的字符串 result_temp = [] #保存 ...
随机推荐
- 有序链表--Java实现
/*有序链表--使用的是单链表实现 *在插入的时候保持按照值顺序排列 *对于删除最小值的节点效率最高--适合频繁的删除最小的节点 * */ public class MySortedLinkList ...
- SVN.服务器迁移方法
SVN项目, 源服务器 : 10.10.13.48 目标服务器: 10.10.13.129 要把SVN项目从.48上迁移到.129上. 做法: 准备: 版本库:vos 源服务器 : 10.10.1 ...
- DB---数据库中Schema的理解
今天看到了Schema一词,对于它的理解网上也是说法很多,有一种受到认可的程度比较大,暂且先使用一下: " 首先我来做一个比喻,什么是Database,什么是Schema,什么是Table, ...
- CentOS设置系统时间、硬件时间、以及定时校对时间
CentOS设置系统时间和时区 一.设置时区 方法一:使用setup工具 setup 选择Timezone configuration 选择Asia/Shanghai 空格键勾选上System clo ...
- CodeForces - 846F Random Query(期望)
You are given an array a consisting of n positive integers. You pick two integer numbers l and r fro ...
- POJ2318 TOYS(叉积判断点与直线的关系+二分)
Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a prob ...
- I - Intersection HDU - 5120(圆环相交面积)
Matt is a big fan of logo design. Recently he falls in love with logo made up by rings. The followin ...
- Best Coder #86 1001 Price List(大水题)
Price List Accepts: 880 Submissions: 2184 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 26214 ...
- Just a Hook(区间set)
Just a Hook Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- 刘强1109 JavaScript基础二(分支与循环结构)
[if-else结构] 1.结构的写法: if(判断条件){ 条件为true时,执行if{} } else{ 条件为false时,执行else{} } 2.注意事项: ① else{}语句块,可以根据 ...