读取二进制文件的语句怎么写??? 以二进制流的方式读取文件的语句怎么写???谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 System.IO.StreamReader sr=new StreamReader(文件路径,编码方式); 通过FileStream来读取文件,msdn有例子。 FileStream fs = System.IO.File.Open(path, System.IO.FileMode.Open); //读文本文件 this.openFileDialog1.ShowDialog(); string MyFileName=this.openFileDialog1.FileName; if(MyFileName.Trim()=="") return; StreamReader MyReader=null; try { MyReader=new StreamReader(MyFileName,System.Text.Encoding.Default); this.richTextBox1.Text=MyReader.ReadToEnd(); } catch(Exception Err) { MessageBox.Show("读文本文件发生错误!请检查源文件是否是文本文件?","信息提示",MessageBoxButtons.OK,MessageBoxIcon.Information); return; } finally { if(MyReader!=null) { MyReader.Close(); } } 急啊,求正则抓取数据问题 怎么样将int型数字转换成7位字符串,不足的时候,前面补0 wcf 服务端返回object报错。 请问如果判断是否按下ctrl+某键??? 不好意思啊,又来讨教sql语句了. 我刚学c语言不久.有没有好心的高手帅哥们能指点一二阿 不需要命令InstallUtil 安装windows服务 谁有北风网的BF-TECH3.0系列培训 使用showdialog关闭时主窗体闪烁 如何制作 Web安装程序? 一定格式显示数据 汉字编码转换问题!!!!
this.openFileDialog1.ShowDialog();
string MyFileName=this.openFileDialog1.FileName;
if(MyFileName.Trim()=="")
return;
StreamReader MyReader=null;
try
{
MyReader=new StreamReader(MyFileName,System.Text.Encoding.Default);
this.richTextBox1.Text=MyReader.ReadToEnd();
}
catch(Exception Err)
{
MessageBox.Show("读文本文件发生错误!请检查源文件是否是文本文件?","信息提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
}
finally
{
if(MyReader!=null)
{
MyReader.Close();
}
}