程序不在另一个目录中工作 [英] Program not working in another directory

查看:54
本文介绍了程序不在另一个目录中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual C ++ Express 2010中有一个用C语言编写的程序。当我在Debug或Release文件夹中运行它时,它运行正常。但是当我在Program Files下的一个文件夹中运行它时,它的一个功能会使程序崩溃。我收到消息,"程序
已停止工作"这可能是什么原因?我已将所有文件传输到Program Files中的文件夹。 

I have a program made in C in Visual C++ Express 2010. When I run it in the Debug or Release folder, it works fine. But when I run it in a folder under Program Files, one of its functions makes the program crash. I get the message, "The program has stopped working" etc. What might be the reason for this? I have transferred all the files to the folder in Program Files. 

提前致谢。

推荐答案

On 3/6/2018 8:35 AM,Gurunama写道:

On 3/6/2018 8:35 AM, Gurunama wrote:


我在Visual C ++ Express 2010中有一个用C语言编写的程序。我在Debug或Release文件夹中运行它,它工作正常。但是当我在Program Files下的一个文件夹中运行它时,它的一个功能会使程序崩溃。我收到消息,"程序
已停止工作"这可能是什么原因?我已将所有文件传输到Program Files中的文件夹。

I have a program made in C in Visual C++ Express 2010. When I run it in the Debug or Release folder, it works fine. But when I run it in a folder under Program Files, one of its functions makes the program crash. I get the message, "The program has stopped working" etc. What might be the reason for this? I have transferred all the files to the folder in Program Files.

我的猜测是,程序在没有管理权限的情况下运行,尝试写入其文件夹在Program Files下,并失败;该文件夹只能由管理员写入。然后由于错误处理不充分而崩溃。

My guess would be, the program runs without administrative privileges, attempts to write to its folder under Program Files, and fails; that folder is only writable by administrators. It then crashes due to inadequate error handling.


这篇关于程序不在另一个目录中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆