Skip to main content

Articles

Featured Products

Stay in touch using the DEVBUSS RSS feeds.
 

News

FTP Controls for .NET Compact Framework

Written by Antoni Massó Mola  [author's bio]  [read 34563 times]
Edited by Derek

Page 1 

FTP’ing with .NET Compact Framework

Mobile applications many times require sending and receiving data to and from a remote server. The most common, reliable and fast method to achieve this is using the File Transfer Protocol (FTP). With Trilium’s .NET CF FTP Control you can now incorporate these powerful functions right into your VB .NET project. Connecting, sending and receiving files from a remote server from within your .NET VB applications can now be done within minutes with this .NET CF Control.

Overview

The .NET CF FTP demo (link: http://www.triliumsoftware.com/downloads.html ) includes all the necessary files to run the project in your Pocket PC device and start using the File Transfer Protocol.

.NET CF FTP Control Functions

  • Connect / Disconnect to an FTP Server
  • Upload / Download files
  • Delete files
  • Rename files
  • Retrieve current directory
  • Change directory
  • Create directories
  • Delete directories
  • Rename directories
  • List files and folders
  • Get Error Response codes

Running the Project

The .NET CF FTP demo includes a VB .NET project and the required DLL’s to run the application on Pocket PC devices or the Pocket PC emulator. The DLL must be copied to the \windows directory in both the emulator and physical device.

FTP Functions Examples

Using Trilium’s .NET CF FTP control is very straightforward. Even developers who have never used .NET will find the demo project very intuitive and easy to use.

Connecting to an FTP Server

This example shows how to connect to a remote FTP server.

Public Declare Function ConnectServer Lib "TriliumNETFTP.dll" (ByVal strServer As String, ByVal strUserName As String, ByVal strPassword As String, ByVal bPassive As Boolean, ByVal iPort As Integer) As Boolean

strServer = FTP Server’s address “ftp.triliumsoftware.com”
strUserName = FTP UserName “user1”
strPassword = FTP Password “password1”
bPassive = true = Passive Connection | false = Non Passive Connection
iPort = FTP Server Port 21

Uploading a file

Public Declare Function UploadFile Lib "TriliumNETFTP.dll" (ByVal strFile As String, ByVal strFile2 As String, ByVal bBinary As Boolean) As Boolean

strFile = File “/File” Server File Name
strFile2 = File “/File” Pocket PC File Name

Downloading a file

Public Declare Function DownloadFile Lib "TriliumNETFTP.dll" (ByVal strFile As String, ByVal strFile2 As String, ByVal bBinary As Boolean) As Boolean

strFile = File “/File” Pocket PC File Name
strFile2 = File “/File” Server File Name

The demo project includes documentation on all the FTP functions of the .NET CF FTP Control.

Conclusion

Include FTP functionality to your VB .NET projects within minutes. FTP’ing from within your VB.NET applications has never been easier with Trilium’s .NET CF FTP control (http://www.triliumsoftware.com/downloads.html ). Visit Trilium's web site frequently, new .NET CF Controls and applications will soon be available.