📄 filesystem.vb
字号:
End Sub Public Sub FilePut(ByVal FileNumber As Integer, ByVal Value As Decimal, Optional ByVal RecordNumber As Long = -1) Throw New NotImplementedException End Sub Public Sub FilePut(ByVal FileNumber As Integer, ByVal Value As Double, Optional ByVal RecordNumber As Long = -1) Throw New NotImplementedException End Sub Public Sub FilePut(ByVal FileNumber As Integer, ByVal Value As Integer, Optional ByVal RecordNumber As Long = -1) Throw New NotImplementedException End Sub Public Sub FilePut(ByVal FileNumber As Integer, ByVal Value As Long, Optional ByVal RecordNumber As Long = -1) Throw New NotImplementedException End Sub Public Sub FilePut(ByVal FileNumber As Integer, ByVal Value As Short, Optional ByVal RecordNumber As Long = -1) Throw New NotImplementedException End Sub Public Sub FilePut(ByVal FileNumber As Integer, ByVal Value As Single, Optional ByVal RecordNumber As Long = -1) Throw New NotImplementedException End Sub Public Sub FilePut(ByVal FileNumber As Integer, ByVal Value As String, Optional ByVal RecordNumber As Long = -1, Optional ByVal StringIsFixedLength As Boolean = False) Throw New NotImplementedException End Sub Public Sub FilePut(ByVal FileNumber As Integer, ByVal Value As System.Array, Optional ByVal RecordNumber As Long = -1, Optional ByVal ArrayIsDynamic As Boolean = False, Optional ByVal StringIsFixedLength As Boolean = False) Throw New NotImplementedException End Sub Public Sub FilePut(ByVal FileNumber As Integer, ByVal Value As System.ValueType, Optional ByVal RecordNumber As Long = -1) Throw New NotImplementedException End Sub#If NET_VER >= 2.0 Then <Obsolete("This member has been deprectated. Try FilePutObject.")> _ Public Sub FilePut(ByVal FileNumber As Object, ByVal Value As Object, Optional ByVal RecordNumber As Object = -1)#Else Public Sub FilePut(ByVal FileNumber As Object, ByVal Value As Object, Optional ByVal RecordNumber As Object = -1)#End If Throw New NotImplementedException End Sub Public Sub FilePutObject(ByVal FileNumber As Integer, ByVal Value As Object, Optional ByVal RecordNumber As Long = -1) Throw New NotImplementedException End Sub Public Sub FileWidth(ByVal FileNumber As Integer, ByVal RecordWidth As Integer) Throw New NotImplementedException End Sub Public Function FreeFile() As Integer Throw New NotImplementedException End Function Public Function GetAttr(ByVal PathName As String) As Microsoft.VisualBasic.FileAttribute If ((PathName = "") Or (PathName Is Nothing)) Then Throw New System.ArgumentException("The path is not of a legal form.") Dim InvalidChars() As Char#If NET_2_0 Then InvalidChars = Path.GetInvalidPathChars()#Else InvalidChars = Path.InvalidPathChars#End If If Not (PathName.IndexOfAny(InvalidChars) = -1) Then Throw New System.ArgumentException("Argument 'PathName' is not a valid value.") End If Dim fi As New FileInfo(PathName) Dim di As New DirectoryInfo(PathName) Dim attr As System.IO.FileAttributes If (fi.Exists Or di.Exists) Then attr = File.GetAttributes(PathName) Else Throw New System.IO.FileNotFoundException("File " + "'" + PathName + "'" + " not found.") End If Return CType(attr, Microsoft.VisualBasic.FileAttribute) End Function Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Boolean) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Byte) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Char) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Date) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Decimal) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Double) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Integer) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Long) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Object) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Short) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As Single) Throw New NotImplementedException End Sub Public Sub Input(ByVal FileNumber As Integer, ByRef Value As String) Throw New NotImplementedException End Sub Public Function InputString(ByVal FileNumber As Integer, ByVal CharCount As Integer) As String Throw New NotImplementedException End Function Public Sub Kill(ByVal PathName As String) If ((PathName = "") Or (PathName Is Nothing)) Then Throw New System.ArgumentException("The path is not of a legal form.") Dim str_parent_dir, str_file_to_delete As String Dim last_ch, i As Integer Dim di As DirectoryInfo Dim tmpFile As FileInfo() last_ch = PathName.LastIndexOf(Path.DirectorySeparatorChar) If (last_ch = -1) Then str_parent_dir = Directory.GetCurrentDirectory() Else str_parent_dir = PathName.Substring(0, last_ch) End If str_file_to_delete = PathName.Substring(last_ch + 1, PathName.Length - last_ch - 1) di = New DirectoryInfo(str_parent_dir) tmpFile = di.GetFiles(str_file_to_delete) If Not (tmpFile.Length = 0) Then For i = 0 To tmpFile.Length - 1 File.Delete(str_parent_dir + Path.DirectorySeparatorChar + tmpFile(i).Name) Next Else Throw New System.IO.FileNotFoundException(" No files found matching: " + PathName) End If End Sub Public Function LineInput(ByVal FileNumber As Integer) As String Throw New NotImplementedException End Function Public Function Loc(ByVal FileNumber As Integer) As Long Throw New NotImplementedException End Function Public Sub Lock(ByVal FileNumber As Integer) Throw New NotImplementedException End Sub Public Sub Lock(ByVal FileNumber As Integer, ByVal Record As Long) Throw New NotImplementedException End Sub Public Sub Lock(ByVal FileNumber As Integer, ByVal FromRecord As Long, ByVal ToRecord As Long) Throw New NotImplementedException End Sub Public Function LOF(ByVal FileNumber As Integer) As Long Throw New NotImplementedException End Function Public Sub MkDir(ByVal Path As String) If ((Path = "") Or (Path Is Nothing)) Then Throw New System.ArgumentException("Argument 'Path' is Nothing or empty.") Dim di As New DirectoryInfo(Path) If (di.Exists) Then Throw New System.IO.IOException("Path/File access error.") Else Directory.CreateDirectory(Path) End If End Sub Public Sub Print(ByVal FileNumber As Integer, ByVal ParamArray Output() As Object) Throw New NotImplementedException End Sub Public Sub PrintLine(ByVal FileNumber As Integer, ByVal ParamArray Output() As Object) Throw New NotImplementedException End Sub Public Sub Rename(ByVal OldPath As String, ByVal NewPath As String) If ((OldPath = "") Or (OldPath Is Nothing) Or (NewPath = "") Or (NewPath Is Nothing)) Then Throw New System.ArgumentException("The path is not of a legal form.") Dim fiNew As New FileInfo(NewPath) Dim fiOld As New FileInfo(OldPath) Dim diNew As New DirectoryInfo(NewPath) Dim diOld As New DirectoryInfo(OldPath) Try Catch ex As DirectoryNotFoundException Throw New System.ArgumentException("Procedure call or argument is not valid.") End Try If Not (fiOld.Exists) And Not (diOld.Exists) Then Throw New System.ArgumentException("Procedure call or argument is not valid.") ElseIf (fiOld.Exists) And Not (diOld.Exists) Then '' MSDN says IOException on this scenario(as File.Move throw), '' but FileSystem.Rename actually returns ArgumentException If fiNew.Exists Then Throw New System.ArgumentException("Procedure call or argument is not valid.") Try File.Move(OldPath, NewPath) Catch ex As DirectoryNotFoundException Throw New System.ArgumentException("Procedure call or argument is not valid.") End Try ElseIf Not (fiOld.Exists) And (diOld.Exists) Then '' MSDN says IOException on this scenario(as Directory.Move throw), '' but FileSystem.Rename actually returns ArgumentException If diNew.Exists Then Throw New System.ArgumentException("Procedure call or argument is not valid.") Try Directory.Move(OldPath, NewPath) Catch ex As DirectoryNotFoundException Throw New System.ArgumentException("Procedure call or argument is not valid.") End Try End If End Sub Public Sub Reset() Throw New NotImplementedException End Sub Public Sub RmDir(ByVal Path As String) Dim fi As FileInfo() If ((Path = "") Or (Path Is Nothing)) Then Throw New System.ArgumentException("Argument 'Path' is Nothing or empty.") Dim di As New DirectoryInfo(Path) fi = di.GetFiles If Not (fi.Length = 0) Then Throw New System.IO.IOException("The directory is not empty.") Else Directory.Delete(Path) End If End Sub Public Function Seek(ByVal FileNumber As Integer) As Long Throw New NotImplementedException End Function Public Sub Seek(ByVal FileNumber As Integer, ByVal Position As Long) Throw New NotImplementedException End Sub Public Sub SetAttr(ByVal PathName As String, ByVal Attributes As Microsoft.VisualBasic.FileAttribute) If ((PathName = "") Or (PathName Is Nothing)) Then Throw New System.ArgumentException("The path is not of a legal form.") Dim InvalidChars() As Char#If NET_2_0 Then InvalidChars = Path.GetInvalidPathChars()#Else InvalidChars = Path.InvalidPathChars#End If If Not (PathName.IndexOfAny(InvalidChars) = -1) Then Throw New System.ArgumentException("Argument 'PathName' is not a valid value.") End If Dim fi As New FileInfo(PathName) Dim di As New DirectoryInfo(PathName) If (fi.Exists Or di.Exists) Then Dim attr As System.IO.FileAttributes attr = CType(Attributes, System.IO.FileAttributes) File.SetAttributes(PathName, attr) Else Throw New System.IO.FileNotFoundException("File " + "'" + PathName + "'" + " not found.") End If End Sub Public Function SPC(ByVal Count As Short) As Microsoft.VisualBasic.SpcInfo Throw New NotImplementedException End Function Public Function TAB() As Microsoft.VisualBasic.TabInfo Throw New NotImplementedException End Function Public Function TAB(ByVal Column As Short) As Microsoft.VisualBasic.TabInfo Throw New NotImplementedException End Function Public Sub Unlock(ByVal FileNumber As Integer) Throw New NotImplementedException End Sub Public Sub Unlock(ByVal FileNumber As Integer, ByVal Record As Long) Throw New NotImplementedException End Sub Public Sub Unlock(ByVal FileNumber As Integer, ByVal FromRecord As Long, ByVal ToRecord As Long) Throw New NotImplementedException End Sub Public Sub Write(ByVal FileNumber As Integer, ByVal ParamArray Output() As Object) Throw New NotImplementedException End Sub Public Sub WriteLine(ByVal FileNumber As Integer, ByVal ParamArray Output() As Object) Throw New NotImplementedException End Sub End ModuleEnd Namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -