通过网络运行exe时出错 [英] Error in running exe over network
本文介绍了通过网络运行exe时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将一个exe放到服务器上,以使所有用户都可以从服务器访问它,但它给出以下错误.请指导如何解决.
I make a exe an put it on server that all the users will be access from server but it give the following error. please guide how it will be solve.
System.Security.SecurityException: Request for the permission of type ''System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Windows.Forms.Application.get_StartupPath()
at ServicsofAlhokar.FrmLSG.FrmLSG_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The action that failed was:
推荐答案
无论您放置了exe,它都是试图在用户没有权限的文件夹中打开文件:检查代码,并找出您要使用的文件夹/文件,并为此修改权限,或者更改程序以使用所有用户都具有适当权限的文件/文件夹!
Wherever you put the exe, it is trying to open a file in a folder that the user does not have permissions for: Check your code, and find out what folder / file you are trying to use, and either get the permissions modified for that, or change to program to use a file / folder that all users have appropriate permissions to use!
您可能无权读取/写入网络上的文件.
尝试确保您可以通过登录名访问这些文件.
另外,请参见此处 [
You probably don''t have access to read / write the files on the network.
Try to ensure you have access to those files with your login.
Also, see here[^].
这篇关于通过网络运行exe时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文