Advertisement
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.Channels;
- using System.Runtime.Remoting.Channels.Tcp;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleClient
- {
- class MyClient
- {
- static void Main(string[] args)
- {
- TcpChannel tcpChannel = new TcpChannel();
- ChannelServices.RegisterChannel(tcpChannel, true);
- Type requiredType = typeof(gradeCalculate);
- gradeCalculate remoteObject = (gradeCalculate)Activator.GetObject(requiredType, "tcp://localhost:9998/DrivingLesson");
- string username, password;
- System.Console.WriteLine("please enter your Username");
- username = Console.ReadLine();
- System.Console.WriteLine("Please enter your password");
- password = Console.ReadLine();
- bool authenticated = remoteObject.authenticate(username,password);
- Console.Clear();
- while (authenticated)
- {
- System.Console.WriteLine("Menu");
- System.Console.WriteLine("1) Enter Marks");
- System.Console.WriteLine("2) Show results");
- System.Console.WriteLine("0) Exit");
- int mainMenuOption = Console.Read();
- switch (mainMenuOption)
- {
- case 1:
- break;
- case 2:
- break;
- case 3:
- break;
- default:
- authenticated = false;
- break;
- }
- }
- System.Console.WriteLine(authenticated );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement