该ws的引用地址是 http://<Site>/_vti_bin/Lists.asmx
Dim instance As Lists Dim listName As String Dim listItemID As String Dim fileName As String Dim attachment As Byte() Dim returnValue As String returnValue = instance.AddAttachment(listName, listItemID, fileName, attachment)
- Public Function AddAttachment(ByVal cookieContainer As System.Net.CookieContainer, ByVal SharePointHost As String, ByVal ID As String, ByVal listName As String, ByVal attachment() As Byte, ByVal attachmentName As String) As Boolean Implements SPInferface.AddAttachment
- Dim node As XmlNode
- Dim WebFullUrl As String
- Dim listitemid As String
- Dim mylist As Lists.Lists = New Lists.Lists()
- mylist.CookieContainer = cookieContainer
- mylist.Url = SharePointHost & "/" & ListsServiceName
- Try
- Dim s As String = mylist.AddAttachment(listName, ID, attachmentName, attachment)
- Catch ex As Exception
- throw ex
- End Try
- Return True
- End Function
这个看下SDK就能明白....