ShiftOS-TheRevival-Old/ShiftOS-TheRevival/MainForms/FileManagement.vb

26 lines
1.1 KiB
VB.net
Raw Normal View History

2022-11-06 14:19:35 +00:00
Imports System.IO
Module FileManagement
Public Sub CatFile(filename As String)
If File.Exists(Terminal.CurrentDirectory & "\" & filename) = True Then
2022-11-07 07:16:34 +00:00
Dim ContentsFinal As String = File.ReadAllText(Terminal.CurrentDirectory & "\" & filename)
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & ContentsFinal
2022-11-06 14:19:35 +00:00
End If
End Sub
2022-11-07 07:16:34 +00:00
Public Sub DeleteFile(filename As String)
If File.Exists(Terminal.CurrentDirectory & "\" & filename) = True Then
File.Delete(Terminal.CurrentDirectory & "\" & filename)
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
File.WriteAllText(Terminal.CurrentDirectory & "\" & filename, Terminal.TextBox1.Text)
End Sub
2022-11-06 14:19:35 +00:00
End Module