Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim sfd As New SaveFileDialog sfd.Filter = "NotePad (*.txt)|*.txt" If sfd.ShowDialog = Windows.Forms.DialogResult.OK Then My.Computer.FileSystem.WriteAllText(sfd.FileName, TextBox1.Text, True) End If End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim sfd As New SaveFileDialog sfd.Filter = "NotePad (*.txt)|*.txt" If sfd.ShowDialog = Windows.Forms.DialogResult.OK Then My.Computer.FileSystem.WriteAllText(sfd.FileName, TextBox1.Text, True) End If End Sub
شكران لحضرت بس بعد ازنك ممكن سؤل اخر هو في كود يخليني افتح ورقه دخل تكست بوكس وشكران
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Dim ofd As New OpenFileDialog ofd.Filter = "NotePad (*.txt)|*.txt" If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then TextBox1.Text = My.Computer.FileSystem.ReadAllText(ofd.FileName, System.Text.Encoding.UTF8) End If End Sub