Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.Remoting;
- using System.Runtime.Remoting.Channels;
- using System.Runtime.Remoting.Channels.Tcp;
- using System.Text;
- using System.Threading.Tasks;
- class EvaluatorServer
- {
- static void Main(string[] args)
- {
- EvaluatorPlatform();
- }
- static void EvaluatorPlatform()
- {
- TcpChannel tcpChannel = new TcpChannel(9998);
- ChannelServices.RegisterChannel(tcpChannel, true);
- Type commonInterfaceType = Type.GetType("Driving");
- RemotingConfiguration.RegisterWellKnownServiceType(commonInterfaceType, "DrivingLesson", WellKnownObjectMode.SingleCall);
- System.Console.WriteLine("Press Enter to Quit");
- System.Console.ReadLine();
- }
- }
- public interface gradeCalculate
- {
- //void Start();
- bool authenticate(string username, string password);
- }
- public class Driving : MarshalByRefObject, gradeCalculate
- {
- string serverUsername, serverPassword ;
- bool authenticated;
- //public void Start()
- //{
- // Console.WriteLine("Started!");
- //}
- public bool authenticate(string username, string password)
- {
- serverUsername = "aa";
- serverPassword = "123";
- if (username == serverUsername && password == serverPassword)
- {
- authenticated = true;
- }
- else
- {
- authenticated = false;
- }
- return authenticated;
- }
- }
Add Comment
Please, Sign In to add comment