摘要:
host by program private void button1_Click(object sender, EventArgs e) { ServiceHost host = new ServiceHost(typeof(PersonService)); WSHttpBinding wsBinding =new WSHttpBinding(); host.AddServiceEndpoint(typeof(IPersonService),wsBinding,new Uri("http://localhost:8766")); host.Opened +=new Ev 阅读全文
摘要:
Service(实现服务契约接口的服务类)namespace Service{ public class PersonService:IPersonService { List<Person> list = new List<Person>(); #region IPersonService 成员 public List<Person> GetAllPerson() { return list; } public void Add(Person person) { list.Add(person); } #endregion }}Contract(服务契约和 阅读全文