标题:[求助]编译成.exe后进行就出现"fileapp.exe遇到问题需要关闭,我们对此引起的 ...
取消只看楼主
jamte
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-7-4
 问题点数:0 回复次数:0 
[求助]编译成.exe后进行就出现"fileapp.exe遇到问题需要关闭,我们对此引起的不便.

兄弟们帮我看看这段代码哪里有问题啊!!!!!!

using System;
using System.IO;
public class FileApp
{
public static void Main()
{
FileStream fsMyfile = new FileStream("myfile.txt" , FileMode.Create, FileAccess.ReadWrite);
StreamWriter swMyfile = new StreamWriter(fsMyfile);
swMyfile.WriteLine("Hello, World");
swMyfile.WriteLine("abcdefghijklmnopqrstuvwxyz");
swMyfile.WriteLine("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
swMyfile.WriteLine("0123456789");
swMyfile.Flush();
BinaryReader brMyfile= new BinaryReader (fsMyfile);
brMyfile.BaseStream.Seek(0, SeekOrigin.Begin);
Console.WriteLine("****************以二进制方式读文件*********************");
Byte b1;
while(brMyfile.PeekChar()>-1)
{
b1=brMyfile.ReadByte();
if(b1 != 13 && b1 != 10)
{
Console.Write("{0}",b1.ToString());
Console.Write(".");
}
else
{
Console.WriteLine();
}
}
Console.WriteLine("\n");
brMyfile.Close();
swMyfile.Close();
fsMyfile.Close();
}
}

出错信息: 编译成.exe后进行就出现"fileapp.exe遇到问题需要关闭,我们对此引起的不便.........

搜索更多相关主题的帖子: fileapp exe swMyfile 编译 
2006-07-20 15:58



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-79355-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.129028 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved