客户信息表单通过按钮单击发送到桌面上的.txt文件

时间:2014-09-10 23:19:20

标签: vb.net

晚上好,

我正在尝试完成我学校的VB.net项目的最后一点。这是一个很棒的比萨饼订购系统。在欢迎屏幕之后,提示用户输入名字/姓氏/电子邮件,然后单击提交(如果他们将任何框留空,则会弹出w / msgbox)。如果可能的话,我需要将输入到textbox1,textbox2和textbox3的信息发送到桌面上的.txt文件中。 这是代码

Public Class CustomerInfo

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Then
            MsgBox("Please Enter Your Information")
            ' Forces user to input something in to all three boxes before being allowed to proceed
            'Prompts user to complete form with a message box.
            'Once information is complete, clicking the submit button will close this form and open the Selection Form.
            Dim desktopPath As String =
   Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
            Dim fileName As String = "customer.txt"
            Dim fullPath As String = IO.Path.Combine(desktopPath, fileName)
            IO.File.AppendAllLines(fullPath, {"textbox1.text & textbox2.text & textbox3.text"})

        else
        Selection.Show()
        Me.Hide()
        End If
    End Sub

我试图上传Windows窗体的截图,但我是论坛新手。这是非常基本的文本框1,2和3,下方有“提交”按钮。 提前感谢您提供的任何帮助。

凯尔

0 个答案:

没有答案
相关问题