Advertisement
Guest User

Untitled

a guest
May 5th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.72 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.Remoting;
  5. using System.Runtime.Remoting.Channels;
  6. using System.Runtime.Remoting.Channels.Tcp;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9.  
  10.  
  11.  
  12. class EvaluatorServer
  13. {
  14.     static void Main(string[] args)
  15.     {
  16.         EvaluatorPlatform();
  17.        
  18.     }
  19.  
  20.     static void EvaluatorPlatform()
  21.     {
  22.         TcpChannel tcpChannel = new TcpChannel(9998);
  23.         ChannelServices.RegisterChannel(tcpChannel, true);
  24.         //Type commonInterfaceType = Type.GetType("GradeCalculate");
  25.         RemotingConfiguration.RegisterWellKnownServiceType(typeof(GradeCalculate), "gradecalculator", WellKnownObjectMode.SingleCall);
  26.  
  27.         System.Console.WriteLine("Server Started...");
  28.         System.Console.ReadLine();
  29.    
  30.  
  31.     }
  32. }
  33.  
  34.  
  35. public class GradeCalculate : MarshalByRefObject
  36. {
  37.     string serverUsername, serverPassword;
  38.     bool authenticated;
  39.  
  40.  
  41.  
  42.  
  43.  
  44.     public bool authenticate(string username, string password)
  45.     {
  46.         serverUsername = "aa";
  47.         serverPassword = "123";
  48.  
  49.         if (username == serverUsername && password == serverPassword)
  50.         {
  51.             authenticated = true;
  52.         }
  53.         else
  54.         {
  55.             authenticated = false;
  56.  
  57.         }
  58.         return authenticated;
  59.     }
  60.  
  61.     public void EnterMarks()
  62.     {
  63.  
  64.     }
  65.  
  66.     //public int[] ShowMarksInInputOrder()
  67.     //{
  68.     //   return marks;
  69.     //}
  70.  
  71.     //public static ArtworkData[] GetDataRecords(int UsersID)
  72.     //{
  73.     //    ArtworkData[] Labels;
  74.     //    Labels = new ArtworkData[3];
  75.  
  76.     //    return Labels;
  77.     //}
  78.  
  79.     //public void Start()
  80.     //{
  81.     //    Console.WriteLine("Started!");
  82.     //}
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement