本文介绍了套接字权限异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自俄罗斯,我不太会英语,所以请问=)
我是使用套接字的客户端服务器应用程序.我在Windows 7 Pro中使用C#2008 Express.在调试时,一切都很好.此外,编译后的可执行文件在我的计算机上也能完美运行.但是,当我在另一台计算机(Windows XP)上运行客户端应用程序时,它抛出异常. SocketPermission异常.我尝试按照说明添加到我的代码中:

Hi, I''m from Russia and I don''t know English very well, so excuse me =)
I''m makin'' a client-server application using Socket. I use C# 2008 Express in Windows 7 Pro. While debuging everything is fine. Also, compiled executables work perfectly on my computer. But when I run a Client-application on another computer (Windows XP), It throw an exeption. SocketPermission Exception. I tried adding to my code following instructions:

System.Net.SocketPermission _permission1;
_permission1 = new SocketPermission(System.Security.Permissions.PermissionState.Unrestricted);
_permission1.Assert();



但是仍然有例外.那么,我需要做些什么来解决这个问题?

哦,差点忘了,当套接字尝试连接()时会出现异常;



But exception is still throwing. So, what I need to do to solve that problem?

Oh, almost forgot, An exception appears when the socket is trying to Connect();

推荐答案


这篇关于套接字权限异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 03:22
查看更多