0

私はC#を初めて使用し、電子メールを送信するためのVBサブルーチンを持っています。

C#に変換する方法がわかりません。誰か助けてもらえますか?

ここにサブがあります:

Sub SendAdditionalEmails()
    Dim strDelimeter As String = ","
    Dim strEmailResult As String = ""
    'make sure they dont put a comma on the end (To)
    If InStr(Len(txtTo.Text) - 1, txtTo.Text, ",") > 0 Then
        txtTo.Text = Mid(txtTo.Text, 1, Len(txtTo.Text) - 1)
    End If

    'put the emails into the array
    Dim splitout As Array = Split(txtTo.Text, strDelimeter)
    Dim i As Integer = 0
    Me.pnlError.Visible = False
    For i = 0 To UBound(splitout)
        'loop through all the emails and send them ...
        '-------------------------------------------------------------------
        If SendEmail(splitout(i), txtSubject.Text, txtMessage.Text) = True Then
            txtTo.Text = ""
            txtSubject.Text = ""
            txtMessage.Text = ""
            chkTenantBrochure.Checked = False
            lblSuccess.Text = lblSuccess.Text & "An email was sent to: " & splitout(i) & "<br>"
            lblSuccess.Visible = True
        Else
            Me.pnlError.Visible = True
            lblError.Text = lblError.Text & "An email did not get sent to: " & splitout(i) & "<br>"
            lblError.Visible = True
        End If

    Next
End Sub
4

4 に答える 4

1

この質問をご覧になることをお勧めします。

VB.NETをC#に変換する良い方法はありますか?

于 2009-12-30T21:05:52.350 に答える
1

Telerikには、VB.NetをC#に変換するための非常に便利なWebインターフェイスがあります。

于 2009-12-30T21:07:31.647 に答える
1

この機会に、c# と vb.net の両方の知識を増やし、自分で変換することができます。

于 2009-12-30T21:19:18.033 に答える
0

Redgateの.NETReflectorを使用して、コンパイルされたVB.NETコードをC#に逆アセンブルできます。

于 2009-12-30T21:05:20.370 に答える