VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Save a file into a .txt file

by Mohamed irfan Junaideen (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 19th April 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Save a file into a .txt file

Rate Save a file into a .txt file




If Check1.Value = 1 Then
    Form1.BackColor = vbBlue
   ElseIf Check1.Value = 0 Then
     Form1.BackColor = vbRed
     
     End If
     
    
      

    

End Sub

Private Sub Command1_Click()
End



End Sub

Private Sub Command2_Click()
Dim MSG As String


Text1.Text = ""
If Text1.Text = "" Then
     MSG = MsgBox("List Cleared", vbYesNoCancel + vbInformation, "Done")
          
                End If
     
     
End Sub

   Private Sub created_Click()
Dim intMsg As String
Dim StudentName As String
Dim studentage As String
Dim address As String
Dim TD As String


Open "C:\Documents and Settings\Administrator\My Documents\sample.txt" For Append As #1

intMsg = MsgBox("File sample.txt opened")

        StudentName = InputBox("Enter the student Name")

        studentage = InputBox("enter the student name")
        
        address = InputBox("Enter Address")
        
        Print #1, StudentName & "," & studentage & "," & address & ","; TIMEDATE.Text
        

      


intMsg = MsgBox("Writing a" & StudentName & studentage & address & "to sample.txt ")


Close #1

intMsg = MsgBox("File sample.txt closed")
End Sub






Private Sub Form_Load()
Dim MM As Date
Dim S As String

Caption = "Enter a Date"

DD = Date
MM = Date
YY = Date

TIMEDATE.Visible = False
Text1.Enabled = False
TIMEDATE.Text = S & "    " & Time & " " & Date



End Sub

Private Sub read_Click()
Dim variable1 As String
     Dim xfreefile As Integer
      xfreefile = FreeFile
     Open "C:\Documents and Settings\Administrator\My Documents\sample.txt" For Input As #xfreefile
       Text1.Text = ""
       Text1.ForeColor = &HFF&
       
       
        Do While EOF(xfreefile) = False
            Input #1, variable1
            Text1.Text = Text1.Text & " " & variable1
        Loop
Close #1
End Sub


Download this snippet    Add to My Saved Code

Save a file into a .txt file Comments

No comments have been posted about Save a file into a .txt file. Why not be the first to post a comment about Save a file into a .txt file.

Post your comment

Subject:
Message:
0/1000 characters