Blue Theme Orange Theme Green Theme Red Theme
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Home | Forums | Videos | Photos | Blogs | Beginners | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
DevExpress UI Controls
Search :       Advanced Search »
Home » VB.NET » Calling WinINet API from VB.NET : Part 2

Calling WinINet API from VB.NET : Part 2

This is an API which connects with the remote server . After connecting it brings the files to your local disk without the “Save to Disk” dialogue box . Please contact the author for any problems.

Page Views : 9075
Downloads : 207
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
Download Files:
CallingWinINetInVBNet2VK.zip
 
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 

Description.

This is an API which connects with the remote server . After connecting it brings the files to your local disk without the "Save to Disk" dialogue box . Please contact the author for any problems.

Source Code:

API Description:

URLDownloadToFile:

API : Public Shared Function <DllImport("urlmon")> _
URLDownloadToFile(
ByVal pCaller As Integer, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Integer, _
ByVal lpfnCB As Integer) As Integer
End
Function

Function: Downloads bits from the Internet and saves them to a file.

Parameters.

pCaller

Address of the controlling IUnknown interface of the calling ActiveX® component (if the caller is an ActiveX component). If the calling application is not an ActiveX component, this value can be set to NULL. Otherwise, the caller is a COM object that is contained in another component (such as an ActiveX control within the context of an HTML page). This parameter represents the outermost IUnknown of the calling component. The function attempts the download within the context of the ActiveX client framework and allows the caller's container to receive callbacks on the progress of the download.

szURL

Address of a string value containing the URL to be downloaded. This cannot be set to NULL.

szFileName

Address of a string value containing the name of the file to create for bits that come from the download.

dwReserved

Reserved for future use. Must be zero.

lpfnCB

Address of the caller's IBindStatusCallback interface. URLDownloadToFile calls this interface's IBindStatusCallback::OnProgress method on a connection activity, including the arrival of data. IBindStatusCallback::OnDataAvailable is never called. Implementing IBindStatusCallback::OnProgress allows a caller to implement a user interface or other progress monitoring functionality. It also allows the download operation to be canceled by returning E_ABORT from the IBindStatusCallback::OnProgress call. This can be set to NULL.

Return Value.

Returns one of the following values: 

E_OUTOFMEMORY The buffer length is invalid or there was insufficient memory to complete the operation.

S_OK The operation succeeded. 

Remarks.

The client can choose to be notified of progress through a notification callback.

This function retrieves a file from the FTP server and stores it under the specified file name, creating a new local file in the process. 

General Description:

Before running the code make sure you enter a correct site name. On having proper user access you can download, rename, delete and move the files using API's. This code is written where the access is limited to the users.

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Vishal Kulkarni
Vishal Kulkarni presently working with E-Forum systems Pvt. Ltd. in Nagpur, India. He is working as a software developer. His fields of expertise are VB 6.0, VB.NET, ASP, ASP.NET, COM/DCOM, XML, XSL, JavaScript, SQL Server, Oracle and MS-Access, Verisign (Code signing) , Installshield etc.
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Discover the top 5 tips for understanding .NET
Ricky Leeks presents the top 5 tips for understanding .NET Interoperability. Learn more.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
 Comments
Some Error Messages! by DigiOz On April 7, 2006

Hi

I think you need add the namespace of   System.Runtime.InteropServices first

second, the method of Dispose please keep default

the last,the file never download from site that is my problem too

Reply | Email | Modify 
DevExpress Free UI Controls
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.