Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i want to set the textbox text to what is in a file

so far i have

 

        Dim oFile As System.IO.File
       Dim oRead As System.IO.StreamReader
       oRead = oFile.OpenText("settings.ini")
       Me.homepage.Text(oRead)

but "Me.homepage.Text(oRead)" is wrong, can anyone help?

Page Edit 2.0 Alpha 2 OUT NOW!

- Download Now -

Posted

well all that is in settings.ini is just a url to a site

Settings.ini:

http://www.trelio.com/

 

all i want to do is just make the text box show the contents of the settings.ini file

Page Edit 2.0 Alpha 2 OUT NOW!

- Download Now -

Posted

well i tried a diff way but it still dont work

        Dim oFile As System.IO.File
       Dim oRead As System.IO.StreamReader
       oRead = oFile.OpenText("settings.ini")
       homepage.AppendText(oRead)
       oRead.Close()

"Form4.vb(86): Value of type 'System.IO.StreamReader' cannot be converted to 'String'."

that line is "homepage.AppendText(oRead)"

Page Edit 2.0 Alpha 2 OUT NOW!

- Download Now -

  • Administrators
Posted

Did you try Mutant's suggestion? You cannot simply use a StreamReader instead of a string - you need to call one of it's Methods to read from the file. Assuming homepage is a textbox try

       Dim oFile As System.IO.File
       Dim oRead As System.IO.StreamReader
       oRead = oFile.OpenText("settings.ini")
       homepage..Text= oRead.ReadToEnd()
       oRead.Close()

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
Did you try Mutant's suggestion? You cannot simply use a StreamReader instead of a string - you need to call one of it's Methods to read from the file. Assuming homepage is a textbox try

       Dim oFile As System.IO.File
       Dim oRead As System.IO.StreamReader
       oRead = oFile.OpenText("settings.ini")
       homepage..Text= oRead.ReadToEnd()
       oRead.Close()

Hey thanks that got it working :)

how would i make it just read the top line? or XX line ?

Page Edit 2.0 Alpha 2 OUT NOW!

- Download Now -

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...