L
lufang
Unregistered / Unconfirmed
GUEST, unregistred user!
大致如下代码,基本上也是网上找的。以前用直接存在数据库的大字段中,360没事,现在改为通过WEB服务上传,老是当病毒查,需要怎么改一下?..........uses service1;...........begin msByte := tmemorystream.create; msByte.LoadFromFile(sf); setlength(vByte, msByte.size); msByte.position := 0; msByte.read(vByte[0], msByte.size); HTTPRIO1 := THTTPRIO.create(nil); HTTPRIO1.URL := 'http://IP/webservice1/service1.asmx'; HTTPRIO1.HTTPWebNode.Agent := 'Borland SOAP 1.2'; HTTPRIO1.HTTPWebNode.UseUTF8InHeader := true; try Iservice := HTTPRIO1 as Service1Soap; Iservice.ufb(vByte, df); Iservice := nil; HTTPRIO1.free; msByte.free;finall Iservice := nil; HTTPRIO1.free; msByte.free; end;////////unit service1;interfaceuses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;type Service1Soap = interface(IInvokable) ['{CFE467D4-A39E-2BD2-5836-7685A9E27F8D}'] function ufb(const Bytes: TByteDynArray; const FileName: WideString): WideString; stdcall; function ufcb(const Bytes: TByteDynArray; const Position: Integer; const FileName: WideString): WideString; stdcall; end;function GetService1Soap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): Service1Soap;implementationfunction GetService1Soap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): Service1Soap;const defWSDL = 'http://10.8.18.40/webservice1/service1.asmx?wsdl'; defURL = 'http://10.8.18.40/webservice1/service1.asmx'; defSvc = 'Service1'; defPrt = 'Service1Soap';var RIO: THTTPRIO;begin Result := nil; if (Addr = '') then begin if UseWSDL then Addr := defWSDL else Addr := defURL; end; if HTTPRIO = nil then RIO := THTTPRIO.Create(nil) else RIO := HTTPRIO; try Result := (RIO as Service1Soap); if UseWSDL then begin RIO.WSDLLocation := Addr; RIO.Service := defSvc; RIO.Port := defPrt; end else RIO.URL := Addr; finally if (Result = nil) and (HTTPRIO = nil) then RIO.Free; end;end;initialization InvRegistry.RegisterInterface(TypeInfo(Service1Soap), 'http://tempuri.org/', 'utf-8'); InvRegistry.RegisterDefaultSOAPAction(TypeInfo(Service1Soap), 'http://tempuri.org/%operationName%'); InvRegistry.RegisterInvokeOptions(TypeInfo(Service1Soap), ioDocument);end.