Using the DispHelper lib (works fine):
Code: Select all
dhToggleExceptions(#True)
Procedure DownLoadWebImage(szURL.s, szFileName.s)
Protected objHTTP.l
objHTTP = dhCreateObject("System.Net.WebClient")
If objHTTP
dhCallMethod(objHTTP,".Downloadfile (%s,%s)",@szURL, @szFileName)
dhReleaseObject(objHTTP)
ProcedureReturn #True
EndIf
EndProcedure
If DownLoadWebImage("http://www.purebasic.fr/english/styles/subsilverPlus/imageset/purebasic_logo.png", "h:\purebasic_logo.png")
MessageRequester("Info", ".NET component called successfully.")
Else
MessageRequester("Error", ".NET component called unsuccessfully!")
EndIf
EDIT:
see srod's code to get it to work with COMmate.
thanks srod

Now there is no one stopping you to use some of the .NET classes to get the job done.
Take care...
fsw