Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Runtime.Remoting.Channels;
- using System.Runtime.Remoting.Channels.Tcp;
- using System.Windows.Forms;
- 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;
- int totalModules;
- int[] marks = new int[31];
- String EvaluatorResults;
- 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] = Convert.ToInt32(Console.ReadLine());
- //Console.WriteLine("you have entereed " + marks[i]);
- }
- }
- EvaluatorResults = remoteObject.Evaluator(username, marks, totalModules);
- System.Console.WriteLine(EvaluatorResults);
- }
- }
- }
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void textBox3_TextChanged(object sender, EventArgs e)
- {
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void label1_Click_1(object sender, EventArgs e)
- {
- }
- private void textBox18_TextChanged(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement