收录日期:2019/12/07 11:53:41 时间:2010-10-28 16:59:34 标签:vb.net,append,text-files

i need the following line to write START http:// in vba however it wont write ithe http:// part to the pgp (text based) file whats the trick for this?

objWriter.WriteLine((TextBox5.Text) + "," + "     " + "START http://" + (TextBox6.Text)

This is the rest of the code if nesesary:

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim FILE_NAME As String = "C:\test.pgp"

    If System.IO.File.Exists(FILE_NAME) = True Then
        Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
        objWriter.WriteLine((TextBox2.Text) + "," + "        " + "*" + (TextBox1.Text))
        objWriter.Close()
        MsgBox("The acad.pgp file was successfully appended…")
    Else
        MsgBox("File missing reinstall or contact vendor…")
    End If
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
    Dim FILE_NAME As String = "C:\test.pgp"

    If System.IO.File.Exists(FILE_NAME) = True Then
        Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
        objWriter.WriteLine((TextBox3.Text) + "," + "     " + "START " + (TextBox4.Text) + ", 1,,")
        objWriter.Close()
        MsgBox("The acad.pgp file was successfully appended…")
    Else
        MsgBox("File missing reinstall or contact vendor…")
    End If
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
    Dim FILE_NAME As String = "C:\test.pgp"

    If System.IO.File.Exists(FILE_NAME) = True Then
        Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
        objWriter.WriteLine((TextBox5.Text) + "," + "     " + "START http://" + (TextBox6.Text) + ", 1,,")
        objWriter.Close()
        MsgBox("The acad.pgp file was successfully appended…")
    Else
        MsgBox("File missing reinstall or contact vendor…")
    End If
End Sub

End Class

Try concatening with & instead +