本帖最后由 xinrensheng 于 2012-07-21 15:45:21 编辑

解决方案 »

  1.   


    Dim dic As New Dictionary(Of String, String)
            dic.Add("111", "")
            dic.Add("32", "")
            For Each k In dic.Keys
                ...
            Next
      

  2.   

    这里这个k不用先dim下什么就可以用呵?不会有什么意外的?
    另外我这个k是文件路径,我想作为邮件附件的,我这样: 
     For Each k In dic.Keys
                MailMessage.Attachments.Add(k)
            Next
    它报错,提示说:类型string的值无法转换为system.net.mail.attchment  .要怎么办呢? 意思是说字符串无法转换为附件? 可是我直接用字符串比如MailMessage.Attachments.Add("c:\111.txt")是可以的.
      

  3.   

    错误 4 类型“String”的值无法转换为“System.Net.Mail.Attachment”。
    要怎么办呢?求大侠们帮看下.
    多谢!!