本文整理汇总了VB.NET中Microsoft.VisualBasic.FileSystem.Seek方法的典型用法代码示例。如果您正苦于以下问题:VB.NET FileSystem.Seek方法的具体用法?VB.NET FileSystem.Seek怎么用?VB.NET FileSystem.Seek使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualBasic.FileSystem
的用法示例。
在下文中一共展示了FileSystem.Seek方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1:
Structure Record ' Define user-defined type.
Dim ID As Integer
Dim Name As String
End Structure
示例2: EOF
FileOpen(1, "TESTFILE", OpenMode.Random)
Do While Not EOF(1)
WriteLine(1, Seek(1)) ' Write record number.
FileGet(1, MyRecord, -1) ' Read next record.
Loop
FileClose(1)
示例3: EOF
' Report character position at beginning of each line.
Dim TextLine As String
FileOpen(1, "TESTFILE", OpenMode.Input) ' Open file for reading.
While Not EOF(1)
' Read next line.
TextLine = LineInput(1)
' Position of next line.
MsgBox(Seek(1))
End While
FileClose(1)
示例4:
Dim someText As String = "This is a test string."
' Open file for output.
FileOpen(1, "TESTFILE", OpenMode.Input)
' Move to the third character.
Seek(1, 3)
Input(1, someText)
Console.WriteLine(someText)
FileClose(1)