2022-11-06 14:19:35 +00:00
|
|
|
|
Imports System.IO
|
|
|
|
|
|
|
|
|
|
Module FileManagement
|
|
|
|
|
Public Sub CatFile(filename As String)
|
2022-11-13 08:15:05 +00:00
|
|
|
|
If File.Exists(Console.CurrentDirectory & "\" & filename) = True Then
|
|
|
|
|
Dim ContentsFinal As String = File.ReadAllText(Console.CurrentDirectory & "\" & filename)
|
2022-11-13 14:22:42 +00:00
|
|
|
|
NewLine(ContentsFinal)
|
2022-11-18 23:54:01 +00:00
|
|
|
|
Else
|
|
|
|
|
NewLine("File is not exist")
|
2022-11-06 14:19:35 +00:00
|
|
|
|
End If
|
|
|
|
|
End Sub
|
2022-11-07 07:16:34 +00:00
|
|
|
|
|
2022-11-07 12:22:19 +00:00
|
|
|
|
Public Sub DeleteFile(filename As String)
|
2022-11-13 08:15:05 +00:00
|
|
|
|
If File.Exists(Console.CurrentDirectory & "\" & filename) = True Then
|
|
|
|
|
File.Delete(Console.CurrentDirectory & "\" & filename)
|
2022-11-18 23:54:01 +00:00
|
|
|
|
Else
|
|
|
|
|
NewLine("File is not exist")
|
2022-11-07 12:22:19 +00:00
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
2022-11-07 07:16:34 +00:00
|
|
|
|
Public Sub SaveFile(filename As String)
|
|
|
|
|
'If File.Exists(Terminal.CurrentDirectory & "\" & filename) = False Then
|
|
|
|
|
' File.WriteAllText(Terminal.CurrentDirectory & "\" & filename, Terminal.TextBox1.Text)
|
|
|
|
|
'Else
|
|
|
|
|
' File.WriteAllText(Terminal.CurrentDirectory & "\" & filename, Terminal.TextBox1.Text)
|
|
|
|
|
'End If
|
2022-11-13 08:15:05 +00:00
|
|
|
|
File.WriteAllText(Console.CurrentDirectory & "\" & filename, Console.TextBox1.Text)
|
2022-11-07 07:16:34 +00:00
|
|
|
|
End Sub
|
2022-11-06 14:19:35 +00:00
|
|
|
|
End Module
|