Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 ? String.Format("{0} <br> {1}" , Label1.text, ...

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-06-04 : 23:42:34
I found a code that reads lines from a text file. Each line ends with a crriage return in that text file.

That code uses a streamReader to read the text file and puts the result in a Label Control. Interestingly, when it reads each line using strm.ReadLine method, it then uses:

String.Format("{0} <br> {1}" , Label1.text, strm.ReadLine)

to insert the carriage return and display the results in a Label control.

My 2 questions pls:

1/ I Have no idea what the line of code above means

2/ Why when I tried doing the same thing for a TextBox control I merly used VBCrLf like this:

TextBox1.text= strm.readline & VBCrLf

and it worked well, whereas with Label control I have to use the code: String.Format("{0} <br> {1}" , Label1.text, strm.ReadLine) in order to insert my carriage returns as well

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2006-06-05 : 01:39:21
I don't think that code is doing what you think it is doing.
Look in the documentation for String.Format, and look up stream readers.



Damian
"A foolish consistency is the hobgoblin of little minds." - Emerson
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-06-05 : 16:08:11
thank you
Go to Top of Page
   

- Advertisement -