93 |
} |
} |
94 |
|
|
95 |
|
|
96 |
void startRemoteControl() |
public void startRemoteControl() |
97 |
{ |
{ |
98 |
// Step 1 Create a URI to serve as the base address. |
// Step 1 Create a URI to serve as the base address. |
99 |
Uri baseAddress = new Uri("http://localhost:8000/RemoteControl/"); |
string hostName = System.Net.Dns.GetHostName(); |
100 |
|
Uri baseAddress = new Uri("http://" + hostName + ":8000/RemoteControl/"); |
101 |
|
|
102 |
|
|
103 |
// Step 2 Create a ServiceHost instance |
// Step 2 Create a ServiceHost instance |
104 |
selfHost = new ServiceHost(typeof(RemoteControl), baseAddress); |
selfHost = new ServiceHost(typeof(RemoteControl), baseAddress); |