爱福特车友会

fyqwkvza

这家伙很懒什么也没留下!

日志

Nike ** Thea Nz

已有 354 次阅读2014-12-2 19:52 | Nike

How to read and display text file data throughout ASP

You can read text data files using StreamReader class. StreamReader class has got Read(), ReadBlock(), ReadLine() and ReadToEnd() methods. 1st two methods read maximum heroes from the current stream using given length from starting off index. ReadLine() method reads a new line of characters and return data as string. ReadToEnd() approach reads stream from the present position to the end of supply. ReadToEnd() method reads stream out of current position to the end from Nike ** Thea Nz the file. I have assigned text file data to cord variable and displayed that in TextBox control.

I have developed a char array to read data coming from text file using ReadBlock() process. ReadBlock() method takes three details, char buffer, starting index along with number of characters to read. The idea returns characters and I include converted these characters straight into string using StringBuilder class in addition to displayed this string inside a TextBox control.

Read() method says the next character and developments the position to one character. The actual overloaded of Read() approach do the same as ReadBlock and takes same parameters. I have used Optimum() method in While Loop condition. The Peak() method returns another character but do not use it. Your Read() method will read through characters until the Peak() approach returns last character. I have used same StringBuilder class to build cord and then displayed it in a very TextBox control.

I have used ArrayList object to demonstrate the ReadLine() method. In While Trap condition, I have used EndofStream property to evaluate whether the current stream situation is at the end. ReadLine() method says a line of character as well as returns a string. We've added each line in order to ArrayList object and bound this kind of ArrayList object to ListBox control.

路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)

主题

积分38

粉丝

  • fyqwkvza +加为好友
  • 就不告诉你
  • 未填写