Web Service
Retrieve Server IP Address
[WebMethod(Description="Get Server IP Address")]
public string GetServerIPAddress()
{
// used to build entire input
StringBuilder sb = new StringBuilder();
// used on each read operation
byte[] buf = new byte[8192];
HttpWebRequest request =
(HttpWebRequest)[Link]("[Link]
HttpWebResponse response = (HttpWebResponse)[Link]();
// we will read data via the response stream
Stream resStream = [Link]();
string tempString = null;
int count = 0;
do
{
// fill the buffer with data
count = [Link](buf, 0, [Link]);
// make sure we read some data
if (count != 0)
{
// translate from bytes to ASCII text
tempString = [Link](buf, 0, count);
// continue building the string
[Link](tempString);
}
}
while (count > 0); // any more data to read
String __SearchString =
"<input id=\"field\" name=\"host\" type=\"text\" value =\"(.*)\" size=\"85\" />";
[Link] _regex =
new [Link](__SearchString);
return _regex.Match([Link]()).Result("$1").ToString();
}