Visual Basic (Declaration) | |
---|---|
Public Enum RpcAuthentication Inherits System.Enum |
C# | |
---|---|
public enum RpcAuthentication : System.Enum |
Member | Description |
---|---|
RPC_C_AUTHN_DCE_PRIVATE | |
RPC_C_AUTHN_DCE_PUBLIC | |
RPC_C_AUTHN_DEC_PUBLIC | |
RPC_C_AUTHN_DEFAULT | |
RPC_C_AUTHN_DIGEST | |
RPC_C_AUTHN_DPA | |
RPC_C_AUTHN_GSS_KERBEROS | |
RPC_C_AUTHN_GSS_NEGOTIATE | |
RPC_C_AUTHN_GSS_SCHANNEL | |
RPC_C_AUTHN_MQ | |
RPC_C_AUTHN_MSN | |
RPC_C_AUTHN_NONE | |
RPC_C_AUTHN_WINNT |
RpcLibrary/RpcLibrary.Test/TestServerApi.cs
C# | ![]() |
---|---|
Guid iid = Guid.NewGuid(); using (RpcServerApi server = new RpcServerApi(iid)) { server.AddProtocol(RpcProtseq.ncalrpc, "lrpctest", 5); server.AddAuthentication(RpcAuthentication.RPC_C_AUTHN_WINNT); server.StartListening(); RpcServerApi.RpcExecuteHandler handler = delegate(IRpcClientInfo client, byte[] arg) { return arg; }; using (RpcClientApi client = new RpcClientApi(iid, RpcProtseq.ncalrpc, null, "lrpctest")) { client.AuthenticateAs(null, RpcClientApi.Self, RpcProtectionLevel.RPC_C_PROTECT_LEVEL_PKT_PRIVACY, RpcAuthentication.RPC_C_AUTHN_WINNT); server.OnExecute += handler; client.Execute(new byte[0]); server.OnExecute -= handler; try { client.Execute(new byte[0]); Assert.Fail(); } catch (RpcException) { } } } |
VB.NET | ![]() |
---|---|
Dim iid As Guid = Guid.NewGuid() Using server As New RpcServerApi(iid) server.AddProtocol(RpcProtseq.ncalrpc, "lrpctest", 5) server.AddAuthentication(RpcAuthentication.RPC_C_AUTHN_WINNT) server.StartListening() Dim handler As RpcServerApi.RpcExecuteHandler = Function(client As IRpcClientInfo, arg As Byte()) Do Return arg End Function Using client As New RpcClientApi(iid, RpcProtseq.ncalrpc, Nothing, "lrpctest") client.AuthenticateAs(Nothing, RpcClientApi.Self, RpcProtectionLevel.RPC_C_PROTECT_LEVEL_PKT_PRIVACY, RpcAuthentication.RPC_C_AUTHN_WINNT) server.OnExecute += handler client.Execute(New Byte(0) {}) server.OnExecute -= handler Try client.Execute(New Byte(0) {}) Assert.Fail() Catch generatedExceptionName As RpcException End Try End Using End Using |
System.Object
System.ValueType
System.Enum
CSharpTest.Net.RpcLibrary.RpcAuthentication
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
CSharpTest.Net.RpcLibrary NamespaceRpcAuthentication IRpcClientInfo.AuthenticationLevel
RpcClientApi.AuthenticateAs(String,NetworkCredential,RpcProtectionLevel,RpcAuthentication[])
Boolean RpcServerApi.AddAuthentication(RpcAuthentication)
Boolean RpcServerApi.AddAuthentication(RpcAuthentication,String)