Csharp/CSharp Tutorial/Network/SocketPermission
Версия от 15:31, 26 мая 2010; (обсуждение)
Minimum permission request for SocketPermission
using System;
using System.Net;
using System.Security.Permissions;
[assembly: SocketPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
class MainClass
{
public static void Main()
{
}
}
SocketPermission that allows the code to open a TCP connection to the specified host and port
using System;
using System.Net;
using System.Security.Permissions;
[assembly:SocketPermission(SecurityAction.RequestMinimum, Access = "Connect", Host = "www.nfex.ru", Port = "9999", Transport = "Tcp")]
class MainClass
{
public static void Main()
{
}
}