mattijsstu
Member
- Joined
- Feb 19, 2013
- Messages
- 15
- Programming Experience
- Beginner
hi
I have been searching the web for a whil and i am stuck in my program. I want to write a value of a textbox on a .txt file. Butch i don't know the path of it becos i have to choose it in the save dialog(wich i want to use ofcours). So how do i get my text in the file? this is my program so far:
I have been searching the web for a whil and i am stuck in my program. I want to write a value of a textbox on a .txt file. Butch i don't know the path of it becos i have to choose it in the save dialog(wich i want to use ofcours). So how do i get my text in the file? this is my program so far:
VB.NET:
Public Class Form1
Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles SAVE.Click
Dim myStream As IO.Stream
Dim saveFileDialog1 As New SaveFileDialog()
saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
saveFileDialog1.FilterIndex = 2
saveFileDialog1.RestoreDirectory = True
If saveFileDialog1.ShowDialog() = DialogResult.OK Then
myStream = saveFileDialog1.OpenFile()
If (myStream IsNot Nothing) Then
myStream.Close()
End If
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox3.Text = Val(TextBox1.Text) ^ (2 / 3) * 50
End Sub
End Class