|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Why use Demand()?I am not sure why one should use the Demand() method? Wouldn't the attempt
to access the resource thrown the same security exception? For example does the below Demand() actually help in any way? SocketPermission socketPermission = new SocketPermission(System.Net.NetworkAccess.Connect,System.Net.TransportType.Tcp,Server,Port); socketPermission.Demand(); ipepServer = new IPEndPoint(IPAddress.Parse(Server),nPort); Socket s = new Socket(); s. Connect(ipepServer); Bob it would, but you may have a situation where you want to demand permissions
before you do more work. So if you have a lot more work to do, or perhaps you have multiple permissions that you want to check before you do anything, check them first and save yourself CPU time and cleanup if permission failed. "Bob" <msg***@hotmail.com> wrote in message SocketPermission(System.Net.NetworkAccess.Connect,System.Net.TransportType.Tnews:%23gfODc6iFHA.3300@TK2MSFTNGP15.phx.gbl... > I am not sure why one should use the Demand() method? Wouldn't the attempt > to access the resource thrown the same security exception? For example does > the below Demand() actually help in any way? > > SocketPermission socketPermission = new > cp,Server,Port); Show quoteHide quote > socketPermission.Demand(); > > ipepServer = new IPEndPoint(IPAddress.Parse(Server),nPort); > Socket s = new Socket(); > s. Connect(ipepServer); > > Bob > >
CryptoAPI, System.Security.Cryptography Interoperability
ASPNET Account autiding alert Export/import session key between CryptoAPI/C++ and .NET/C# .NET 2.0 Membership "role context" Authenticate User in Windows 2000 machine IsInRole & SID/Token Caching in .NET v1.1 Cryptography implementation using memeorystream Weird registry behavior when writing to custom event log Configuration Error LDAP and Organization group |
|||||||||||||||||||||||