Пример #1
0
        static void Main(string[] args)
        {
            BinaryConverterServiceClient client = new BinaryConverterServiceClient();

            // Используйте переменную "client", чтобы вызвать операции из службы.
            client.Open();
            Console.Write("Enter a number: ");
            string       n      = Console.ReadLine();
            int          m      = Int32.Parse(n);
            IAsyncResult result = client.BeginGetBinary(m, ar => {
                Console.WriteLine($"The binary of {m} is {client.EndGetBinary(ar)}.");
            }, null);

            while (!result.IsCompleted)
            {
                Thread.Sleep(200);
                Console.WriteLine("Client is working...");
            }
            Console.ReadKey();
            // Всегда закройте клиент.
            client.Close();
        }
Пример #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     client = new BinaryConverterServiceClient();
 }