Hi thanks in advance to anyone who can help as i urgently need some, im trying to return Context.Request.UserHostAddress.ToString();
from my class file so that my web service can display it. But i am unsure how to do it.
I have been told about HttpRequest and HttpContext but have no idea how to use them.
How would i go about returning the IP address so that the web service can pick it up.
Inside the web Service
WebService1.asmx.cs
[WebMethod]
public MyMachine MachineData()
{
MyMachine machine = new MyMachine();
return machine;
}
And in the class file
MyMachine.cs
public class MyMachine
{
private string machineName = System.Environment.MachineName;
public string MachineName
{
get
{
return machineName;
}
set
{
machineName = value;
}
}
//
//Rest of the program
//
}
The WebService shows Details about the users computer.