Имеется сервер, WCF
<?xml version="1.0" encoding="utf-8" ?>
сервер является приложением WinForm
на Форме имеется textBox1
как вывести в textBox1 кто подключился к серверу
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ServiceModel;
using System.Security.Principal;
using WcfChat;
namespace Chatserver
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
ServiceHost host = new ServiceHost(typeof(ChatService));
host.Open();
textBox1.AppendText("Запуск Сервера..... \t\n");
textBox1.AppendText("Configuration Name: " + host.Description.ConfigurationName + "\t\n");
textBox1.AppendText("End point address: " + host.Description.Endpoints[0].Address + "\t\n");
textBox1.AppendText("End point binding: " + host.Description.Endpoints[0].Binding.Name + "\t\n");
textBox1.AppendText("End point contract: " + host.Description.Endpoints[0].Contract.ConfigurationName + "\t\n");
textBox1.AppendText("End point name: " + host.Description.Endpoints[0].Name + "\t\n");
textBox1.AppendText("End point lisent uri: " + host.Description.Endpoints[0].ListenUri + "\t\n");
textBox1.AppendText("Name: " + host.Description.Name + "\t\n");
textBox1.AppendText("Namespace: " + host.Description.Namespace + "\t\n");
textBox1.AppendText("Service Type: " + host.Description.ServiceType + "\t\n");
}
}
}