如题,谢谢
解决方案 »
- HttpWebRequest如何调用html function()
- 菜鸟做《C# 有记忆功能的地址栏控件》这个实例遇到的问题
- 如何取出Repeater的DataItem的值
- 所有的分一次给完吧?难呀!!!!!!!!!!!!!!
- 关于Session丢失的问题,急!!!!
- 如保用ArrayList存储一个二维数组???
- C#调用C++的dll,返回空字符串,求助
- 工具栏中web窗体上面没有treeview怎么办?在线等待
- vs2005 如何在新建窗体中加载DLL(新窗体),求步骤
- arraylist 的 contains问题(在线等)
- vs2005写一个这样的小程序,要多久,要多少钱?
- 操作DataGridView时出现:返回并发性,deletecommand影响了预期1条记录中的0条 的错误!
{
listbox.Items.Add(openFileDialog1.FileName);
}
显示内容:if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
StreamReader reader = new StreamReader(openFileDialog1.FileName);
string line = reader.ReadLine();
while (line != null)
{
listbox.Items.Add(line);
line = reader.ReadLine();
}
reader.Close();
}
{
OpenFileDialog openFiledDialog=new OpenFileDialog();
openFiledDialog.InitialDirectory = "D:\\";
openFiledDialog.Filter = "文本文件|*.*|C#文件|*.cs|所有文件|*.*";
openFiledDialog.FilterIndex= 1;
if (openFiledDialog.ShowDialog() == DialogResult.OK)
{
//打开文件对话框中选择的文件名
string fname = openFiledDialog.FileName;
//创建从字符串进行读取的StringReader对象
StreamReader sr = File.OpenText(fname);
string str;
while((str=sr.ReadLine())!=null)
{
//将读出的字符串在richTextBox1中显示;
this.richTextBox1.Text+=str;
}