Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim strInfo, a As String
        Dim p1, p2, p3 As String
        If TextBox1.Text = "" Then
            a = InputBox("您忘了输入姓名！", "注意")
            If a = "" Then Exit Sub
            TextBox1.Text = a
        End If
        p1 = TextBox1.Text + "，"
        p2 = IIf(RadioButton1.Checked, "男", "女")
        p3 = "，喜欢："
        If CheckBox1.Checked = True Then p3 = p3 + CheckBox1.Text + "、"
        If CheckBox2.Checked = True Then p3 = p3 + CheckBox2.Text + "、"
        If CheckBox3.Checked = True Then p3 = p3 + CheckBox3.Text + "、"
        If CheckBox4.Checked = True Then p3 = p3 + CheckBox4.Text + "、"
        If Strings.Right(p3, 1) = "、" Then
            p3 = Strings.Left(p3, Len(p3) - 1) + "。"
        End If
        strInfo = p1 + p2 + IIf(p3 = "，喜欢：", "无爱好。", p3)
        MsgBox(strInfo, vbYesNo, "个人信息采集")
    End Sub
End Class
