How to Create a Web Service

Wednesday, February 18, 2009

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.IO
Imports System.Data

WebService(Namespace:="http://aaaaa.com/")> _

_
Public Function GetMachineIPAddress() As String

Dim strHostName As String = ""
Dim strIPAddress As String = ""
Dim host As System.Net.IPHostEntry

strHostName = System.Net.Dns.GetHostName()
strIPAddress = System.Net.Dns.GetHostEntry(strHostName).HostName.ToString()

host = System.Net.Dns.GetHostEntry(strHostName)
Dim ip As System.Net.IPAddress
For Each ip In host.AddressList
Return ip.ToString()
Next

Return ""

End Function

0 comments

Post a Comment