Results 1 to 3 of 3

Thread: Convert VB.NET codes to VB6? Anyone, please! T.T

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2010
    Posts
    1

    Convert VB.NET codes to VB6? Anyone, please! T.T

    Greetings! I'm new here & asking for your help guys...Thanks!
    My codes from VB.NET is:
    Code:
    Dim mymailmsg As New MailMessage
            Try
                Dim response As MsgBoxResult = MsgBox("Do you want to continue sending?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Sending Confirmation")
                If response = MsgBoxResult.Yes Then
                    loading.Value = 10
                    mymailmsg.From = New MailAddress("[email protected]")
                    loading.Value = 20
                    mymailmsg.To.Add("[email protected]")
                    loading.Value = 30
                    mymailmsg.Subject = txtSubject.Text
                    loading.Value = 40
                    mymailmsg.Body = document.Text
                    loading.Value = 50
                    Dim smtp As New SmtpClient("smtp.example.com")
                    loading.Value = 60
                    smtp.Port = 587
                    loading.Value = 70
                    smtp.EnableSsl = True
                    loading.Value = 80
                    smtp.Credentials = New System.Net.NetworkCredential("[email protected]", "informatics")
                    loading.Value = 90
                    smtp.Send(mymailmsg)
                    loading.Value = 100
                    MsgBox("You have sent your message!")
                    loading.Value = 0
                Else
                End If
            Catch ex As Exception
            End Try
    Can someone convert my codes to vb6? Thanks!!!
    Last edited by si_the_geek; Sep 2nd, 2010 at 04:48 AM. Reason: added Code tags, changed email addresses to known non-existant ones

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Convert VB.NET codes to VB6? Anyone, please! T.T

    Thread moved from 'Chit Chat' forum to 'VB6 and Earlier' forum

  3. #3
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: Convert VB.NET codes to VB6? Anyone, please! T.T

    Here is th VB6 version. HOWEVER you could need to find a way of sending the emails through VB6 so I've commented out SMTP & mymailmsg.

    Code:
    Dim mymailmsg As New MailMessage
    'Dim smtp As New SmtpClient("smtp.example.com")
    
    Dim MsgBoxResult As Integer
    
        MsgBoxResult = MsgBox("Do you want to continue sending?", vbQuestion + vbYesNo, "Sending Confirmation")
        If MsgBoxResult = vbYes Then
            loading.Value = 10
                'mymailmsg.From = New MailAddress("[email protected]")
            loading.Value = 20
                'mymailmsg.To.Add ("[email protected]")
            loading.Value = 30
                'mymailmsg.Subject = txtSubject.Text
            loading.Value = 40
                'mymailmsg.Body = document.Text
            loading.Value = 50
    
            loading.Value = 60
            smtp.Port = 587
            loading.Value = 70
            smtp.EnableSsl = True
            loading.Value = 80
                'smtp.Credentials = New System.Net.NetworkCredential("[email protected]", "informatics")
            loading.Value = 90
                'smtp.Send (mymailmsg)
            loading.Value = 100
            MsgBox ("You have sent your message!")
            loading.Value = 0
        Else
        End If
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width