L
Lasse Edsvik
Hello
I have this code:
<%@ WebService language="VB" class="TCPUtil" %>
Imports System
Imports System.Web.Services
Imports System.Xml.Serialization
Imports System.Net
<System.Web.Services.WebService(Namespace
:="http://dotnet.100procent.com/tcp")> _
Public Class TCPUtil
<WebMethod(Description:="Returns a list of IPAdresses for an host")> _
Public Function HostToIPAddresses(ByVal Hostname As String) As
String()
Dim MyHost As IPHostEntry
Dim Addresses() As IPAddress
Dim i As Integer
MyHost = Dns.GetHostByName(Hostname)
Addresses = MyHost.AddressList
Dim AddressString(Addresses.GetUpperBound(0)) As String
For i = 0 To Addresses.GetUpperBound(0)
AddressString(i) = Addresses(i).ToString()
Next
HostToIPAddresses = AddressString
End Function
<WebMethod()>
Public Function Add(ByVal a as Integer, ByVal b as Integer) as Integer
Return a+b
End Function
End Class
and that second is just for testing, but i get:
Compiler Error Message: BC32035: Attribute specifier is not a complete
statement. Use a line continuation to apply the attribute to the following
statement.
on the line <WebMethod()> for the second one, have i forgot something or do
i need so add something?
Best regards
/Lasse
I have this code:
<%@ WebService language="VB" class="TCPUtil" %>
Imports System
Imports System.Web.Services
Imports System.Xml.Serialization
Imports System.Net
<System.Web.Services.WebService(Namespace
:="http://dotnet.100procent.com/tcp")> _
Public Class TCPUtil
<WebMethod(Description:="Returns a list of IPAdresses for an host")> _
Public Function HostToIPAddresses(ByVal Hostname As String) As
String()
Dim MyHost As IPHostEntry
Dim Addresses() As IPAddress
Dim i As Integer
MyHost = Dns.GetHostByName(Hostname)
Addresses = MyHost.AddressList
Dim AddressString(Addresses.GetUpperBound(0)) As String
For i = 0 To Addresses.GetUpperBound(0)
AddressString(i) = Addresses(i).ToString()
Next
HostToIPAddresses = AddressString
End Function
<WebMethod()>
Public Function Add(ByVal a as Integer, ByVal b as Integer) as Integer
Return a+b
End Function
End Class
and that second is just for testing, but i get:
Compiler Error Message: BC32035: Attribute specifier is not a complete
statement. Use a line continuation to apply the attribute to the following
statement.
on the line <WebMethod()> for the second one, have i forgot something or do
i need so add something?
Best regards
/Lasse