Opening And Reading Text Files - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Opening And Reading Text Files

iori85ziori85z Posts: 1Member
Hi, I am new to Visual Basic and currently, I need to do a small software, which has a Open button and a textbox. So when I press the open button, it is suppose to open the open dialog box for users to select the text(log) files in C: to open. Then when the user open it, the contents will be viewed on the textbox. Does anyone has a code or solution for this, any help will be greatly appreciated. Thanks.

Comments

  • PavlinIIPavlinII Posts: 404Member
    : Hi, I am new to Visual Basic and currently, I need to do a small software, which has a Open button and a textbox. So when I press the open button, it is suppose to open the open dialog box for users to select the text(log) files in C: to open. Then when the user open it, the contents will be viewed on the textbox. Does anyone has a code or solution for this, any help will be greatly appreciated. Thanks.
    :
    Hi
    [code]Dim iFile as integer, strLog as string, FileName as string
    iFile = FreeFile()
    FileName = "C:logFile.log"
    Open FileName For Binary Access Read As #iFile
    strLog = Space(FileLen(FileName))
    Get #iFile, , strLog
    Close #iFile
    Text1.Text=strLog[/code]
    There exists several ways to get text from file... this is one of them


    [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]

    [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]


  • ghdavisghdavis Posts: 1Member
    : : Hi, I am new to Visual Basic and currently, I need to do a small software, which has a Open button and a textbox. So when I press the open button, it is suppose to open the open dialog box for users to select the text(log) files in C: to open. Then when the user open it, the contents will be viewed on the textbox. Does anyone has a code or solution for this, any help will be greatly appreciated. Thanks.
    : :
    : Hi
    : [code]Dim iFile as integer, strLog as string, FileName as string
    : iFile = FreeFile()
    : FileName = "C:logFile.log"
    : Open FileName For Binary Access Read As #iFile
    : strLog = Space(FileLen(FileName))
    : Get #iFile, , strLog
    : Close #iFile
    : Text1.Text=strLog[/code]
    : There exists several ways to get text from file... this is one of them
    :
    :
    : [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
    :
    : [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
    :
    :
    :

Sign In or Register to comment.