>Imports System.Web.Services >Imports System.IO >Imports System.XML >Imports Microsoft.Web.Services >Imports Microsoft.Web.Services.Dime >>
> <WebMethod()> _ > Public Function UTDCDownloadFile(ByVal tnNumero As Integer) As String > ' Return Me.GetData("2," + tnNumero.ToString, 7) > > ' Get the SoapContext for the response message > Dim loContext As SoapContext > loContext = HttpSoapContext.ResponseContext > > ' Get the file name > Dim lcFile As String > lcFile = "D:\IIS\Universa\About1.jpg" > > ' Create a new DIME attachment using the the file name and > ' specifying the encoding of the attachment using the MIME media type > Dim loDimeAttachment As DimeAttachment > loDimeAttachment = New DimeAttachment("image/jpeg", TypeFormatEnum.MediaType, lcFile) > > ' Generate a GUID-based URI reference for the attachment object > ' and assign in to the ID property of the DIME record > loDimeAttachment.Id = "uri:" + Guid.NewGuid().ToString() > > ' Add the new DimeAttachment object to the SoapContext object > loContext.Attachments.Add(loDimeAttachment) > > ' Return the file name of the attachment > Return "About1.jpg" > > End Function >>
> loContext.Attachments.Add(loDimeAttachment) >>