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);
- GradeCalculate remoteObject = (GradeCalculate)Activator.GetObject(typeof(GradeCalculate), "tcp://localhost:9998/gradecalculator");
- string username, password;
- //bool exit = true;
- int totalModules;
- int[] marks = new int[31];
- 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();
- if (authenticated)
- {
- System.Console.WriteLine("Enter total number modules (atleast 12 and max 30)");
- totalModules = Convert.ToInt32(Console.ReadLine());
- if (totalModules >= 12 && totalModules <= 30)
- {
- //int i = totalNoModules;
- for (int i = 1; i <= totalModules; i++)
- {
- Console.WriteLine("Enter marks for Module " + i);
- marks[i] = Console.Read();
- Console.WriteLine("you have entereed " + marks[i]);
- }
- }
- for (int i =1; i <= totalModules; i++)
- {
- Console.Write("marks ");
- Console.WriteLine(marks[i]);
- }
- }
- //System.Console.WriteLine(authenticated);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement