以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  代码问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=123202)

--  作者:susu312
--  发布时间:2018/8/9 20:02:00
--  代码问题

Dim nums1() As String={"cardID","name","sex","age","birth","tel","jiguan","rational", _
                     "edu","health","workdate","politicalStatus", _
                     "hobbies","retiredPost","title","address","leaOrRetire", _
                    "retireTime","proTecPost","proSpecialty","partyBranch","partyTime", _
                     "presonalClass","organName","partyStanding","retiredDep", _
                     "guanZhu"}
Dim nums2()  As String={"身份证号", "姓名","性别","年龄","出生年月","联系方式","籍贯","民族", _
                     "学历","健康状况","参加工作日期","政治面貌", _
                     "兴趣爱好","离退休职务","享受待遇","地址","状态", _
                    "离退休时间","专业技术职务","专业特长","所在党支部","入党时间", _
                     "个人成分","单位","党龄","部门", _
                     "纪委关注"}

Dim List As WinForm.ListBox = e.Form.Controls("ListBox2")
\'MessageBox.Show(List.Items.Count)

Dim nms As New List(of String)
For i As Integer = 0 To List.Items.count - 1 \'获取已经勾选的列
    int index As Integer=nums2.Indexof(nums2,List.Items(i))
    nms.Add(nums1(index))
    MessageBox.Show(nums1(index))
Next

 

 

 

老师,麻烦您帮我看看这个代码有啥问题?


--  作者:有点甜
--  发布时间:2018/8/9 20:46:00
--  
Dim index As Integer=Array.Indexof(nums2,List.Items(i))
[此贴子已经被作者于2018/8/9 20:45:45编辑过]