在vs里之前能运行的好的程序,现在都是这个问题,请高人指教。有未处理异常 0xC0000005: Access violation

house 5.exe 中的 0x00093750 处有未经处理的异常: 0xC0000005: Access violation

然后输出框里是
……
“house 5.exe”: 已加载“C:\Windows\System32\atiglpxx.dll”,Cannot find or open the PDB file
“house 5.exe”: 已加载“C:\Windows\System32\atioglxx.dll”,Cannot find or open the PDB file
“house 5.exe”: 已加载“C:\Windows\System32\atiadlxx.dll”,Cannot find or open the PDB file
“house 5.exe”: 已加载“C:\Windows\System32\userenv.dll”,已加载符号(去除源信息)。
“house 5.exe”: 已加载“C:\Windows\System32\profapi.dll”,已加载符号(去除源信息)。
“house 5.exe”: 已加载“C:\Windows\System32\wtsapi32.dll”,已加载符号(去除源信息)。
“house 5.exe”: 已加载“C:\Windows\System32\wintrust.dll”,已加载符号(去除源信息)。
“house 5.exe”: 已加载“C:\Windows\System32\atigktxx.dll”,Cannot find or open the PDB file
“house 5.exe”: 已加载“C:\Windows\System32\aticfx32.dll”,Cannot find or open the PDB file
house 5.exe 中的 0x00093750 处最可能的异常: 0xC0000005: Access violation
house 5.exe 中的 0x00093750 处有未经处理的异常: 0xC0000005: Access violation

catch(Exception e){
System.out.println("有错!");
}
你在 System.out.println("有错!");这一行前面加上或改成e.printStackTrace();就能显示堆栈异常了。
其实很简单,你要读取的文件不存在或者是文件名不对,try-catch块代码改成:
try {
File inFile=new File("1.txt");
File outFile=new File("2.txt");
if(!inFile.exists()){
inFile.createNewFile();
}
if(!outFile.exists()){
outFile.createNewFile();
}
bis = new BufferedInputStream(new FileInputStream(inFile));
bos = new BufferedOutputStream(new FileOutputStream(outFile));
bis.read(b, 0, 100);
bos.write(b, 0, 100);
bos.close();
bis.close();
} catch (Exception e) {
e.printStackTrace();
System.out.println("有错!");
}
至于你说的乱码,那其实是String s=b.toString();这一行引起的,这里的s对象其实是字符数组的toString方法返回的结果,当然不是正常的字符串了,要改成String s = new String(b);或
String s = "";
try {
s = new String(b,"UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
编码是什么并不重要,只要不会出现乱码,GBK,gb2312什么的都无所谓
另外,团IDC网上有许多产品团购,便宜有口碑
温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-07-03
Access Violation(非法访问),General Protection Fault(一般保护性错误)或者Invalid Page Fault(无效页面错误),虽然说法不一样,但本质上总是由同一种错误引起的。Access Violation常常在计算机用户运行的程序试图存取未被指定使用的存储区时遇到。
Access violation at address <十六进制值>
in module <应用程序名>
Read of address <十六进制值>

“Access violation at address 00000000.Read of adress 00000000.意思是:在地址 00000000 存取违反,禁止对地址00000000的读取

出现access violation at address 00000000. read of address 00000000.原因是:没有运行服务端软件,所以客户机会提示"Access violation at address 00000000, read of address 0000000",开启服务端程序或检查网线即可解决。

另外,可能出现这个问题的原因是因为你是在WINRAR的窗口中运行程序,而程序又找不到主要文件引起的。

解决方法:)~~
尝试用兼容方式运行该程序.右键点击图标——属性——兼容型——选中“以兼容方式运行该程序”——下面的选框中可以选择以95、98、NT4.0或2000模式来运行。推荐选择98试试看。
第2个回答  2011-06-30
可能之前编译的是 debug 版本,发布后,有些文件依赖。
你可能需要重新编译为 release 版本,再发布,这问题应该就可以解决了。追问

是我所有的程序都不能运行,都要这样?
还有,具体怎么做呀?我不太懂

相似回答