如何通过htmlinputfile控件将文本文件内容读取到Textbox控件里?
解决方案 »
- 新手提问:DetailsView如何绑定数据源
- table中的数据可以编辑
- JQUERY为什么前台有时候能获取到JSON数据,有时候返回的又是空值呢
- 有没有办法从捕获的异常对象中提取函数调用栈中各个函数的实参???
- FAQ是什么意思,经常看到网上有FAQ,不明白
- 怎样编一个有返回值的ORACLE存储过程
- 三个问题。
- http://eu.webmatrixhosting.net/ 这里的主机集合,用此主机的朋友们来交流一下,怎么样?
- 配置错误
- 现在好象提问要代码的越来越多啊!!!!!!!!!!!!
- 用js和webservice.htc 调用c#写的webservice 传到服务器不能用了。
- RadioButtonList怎样显示图片?
using System;
using System.IO;class Test
{
public static void Main()
{
try
{
// Create an instance of StreamReader to read from a file.
// The using statement also closes the StreamReader.
using (StreamReader sr = new StreamReader("TestFile.txt"))
{
String line;
// Read and display lines from the file until the end of
// the file is reached.
while ((line = sr.ReadLine()) != null)
{
Console.WriteLine(line);
}
}
}
catch (Exception e)
{
// Let the user know what went wrong.
Console.WriteLine("The file could not be read:");
Console.WriteLine(e.Message);
}
}
}