Skip to content

System.IO.FileInfo

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #188533
    Some 1
    Member

    Hey guys

    I want to create an instance of System.IO.FileInfo, but i dont know what library to import!! i’m using visual basic 6… does any1 know the full name for it?

    any1?
    Thanks

    #188538
    Admin
    Administrator

    umm man I found this on vbforums.com but i really dont know wha its for 😆

    Dim myString As String
    Dim input As String
    Dim iCount As Integer
    Dim theFile As System.IO.FileInfo
    Dim re As System.IO.StreamReader

    'Open the file to a stream
    theFile = New System.IO.FileInfo("C:yourtextfile.txt")
    re = theFile.OpenText()

    'Read in the first line
    input = re.ReadLine()

    'Loop through each line
    Do While input ""
    iCount = iCount + 1
    'This will let the first four lines go, then
    'it will add the rest of the file to myString.
    If iCount > 4 Then
    'You can put a return character inbetween these two if you
    'want to have a new line for each line added.
    myString = myString & input
    End If
    'Read in the next line for the loop.
    input = re.ReadLine()
    Loop

    'Show your new string.
    MessageBox.Show(myString.ToString())
    #188537
    Departure
    Member

    read the code line for line loco and you will see what its for

    #188536
    Admin
    Administrator

    ah does it has to do with system info crap i dont get it 🙄

    #188535

    the namespace says itself fileinfo that’s mean get info about your file but the code u posted is a little bit strange for me, that guys just want to read the text file but he used fileinfo combined with streamreader.

    u can create un instance of streamreader by giving your file path

    Dim instance As New StreamReader(path)

    and …. 🙂 readline readline readline hehehhe

    #188534

    ah forget to tell you it’s good both. dealing with the file do import system.io namespace to your project.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.