27-07-21, 02:05 AM
27-07-21, 03:13 AM
PHP كود :
Public Class Form1
Dim fpath As String = IO.Path.GetDirectoryName(Application.ExecutablePath) & "\"
Dim fname As String = fpath & "txt.txt"
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim a, s, d As Integer
a = Int(Rnd() * 999)
s = Int(Rnd() * 999)
d = Int(Rnd() * 999)
TextBox1.Text = a
TextBox2.Text = s
TextBox3.Text = d
End Sub
Private Sub savetxt(v1 As String, v2 As String, v3 As String)
If IO.File.Exists(fname) = False Then IO.File.CreateText(fname).Close()
Dim all As String = ""
all = v1 & vbCrLf & v2 & vbCrLf & v3
IO.File.WriteAllText(fname, all)
MsgBox("تم", MsgBoxStyle.Information, "")
End Sub
Private Sub getxt()
TextBox4.Text = Split(IO.File.ReadAllText(fname), vbCrLf)(0)
TextBox5.Text = Split(IO.File.ReadAllText(fname), vbCrLf)(1)
TextBox6.Text = Split(IO.File.ReadAllText(fname), vbCrLf)(2)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
savetxt(TextBox1.Text, TextBox2.Text, TextBox3.Text)
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
getxt()
End Sub
End Class