网站链接: element-ui dtcms
当前位置: 首页 > 技术博文  > 技术博文

虚拟姓名生成器

2021/5/2 7:54:55 人评论

Option Explicit 虚拟姓名生成器 Const surname "赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何" Const Second "中万斯近元伟丽利国士文连百宏可立成海友南广云基" Const Third "娟梅萍菊秋娣隆智渝顺乐天杰夫煜兵思霆炜祺道亮剀炫翔维瑞韬嘉林庆玮…

'Option Explicit
'虚拟姓名生成器
Const surname = "赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何"
Const Second = "中万斯近元伟丽利国士文连百宏可立成海友南广云基"
Const Third = "娟梅萍菊秋娣隆智渝顺乐天杰夫煜兵思霆炜祺道亮剀炫翔维瑞韬嘉林庆玮勤栋源路焕霖彩明邦闻朵皓瀚荣奕涓艺"
Const MaxI = 1000


Private Sub Command1_Click()

For i = 1 To MaxI
a = Int(Rnd * 3) + 2
Debug.Print a
    x = Mid(surname, Int(Rnd * Len(surname)) + 1, 1)
    m1 = Mid(Second, Int(Rnd * Len(Second)) + 1, 1)
    m2 = Mid(Third, Int(Rnd * Len(Third)) + 1, 1)
    If a = 2 Then
        s = x + "  " + m2
    Else
        s = x + m1 + m2
    End If
        s1 = s1 & s & vbCrLf
    Next
    Text1 = s1
    Text1.SetFocus
    Text1.SelStart = 0
    Text1.SelLength = Len(Text1)
    Call WriteTxt(App.Path & "\虚拟名称.txt", Text1)
End Sub

Function WriteTxt(FilePath As String, str As String)
    Open FilePath For Append As #1
    Print #1, str
    Close #1 '
End Function

Private Sub Command2_Click()
    Randomize
    Command1_Click
    Command2.Enabled = False
End Sub

Private Sub Form_Load()
Me.Show
Command1_Click
End Sub
标题虚拟姓名生成器

 

相关资讯

    暂无相关的数据...

共有条评论 网友评论

验证码: 看不清楚?