Question 'FtpClient' is not defined

mike phillips

Member
Joined
Aug 21, 2015
Messages
7
Programming Experience
5-10
I am trying to convert from VBA to VB.net. I thought I had already posted this but cannot find it.

I have a routine in VBA which parses an HTML form, through Excel to a word doc. I need to access FTP in vb.net.

I have gleaned that I need to import system.net

Working Win7, Visual Studio Comminity 2015.

My line 'Imports System.Net' appears to be highlighted 'dark text' in the code editor.

The following line 'Imports System.Net.FtpClient'results in a debug 'BC30002 Type 'FtpClient' is not defined.'

A bit stuck!

Any help appreciated.
 

mike phillips

Member
Joined
Aug 21, 2015
Messages
7
Programming Experience
5-10
Hi,

Hope that helps.
Seems to have cleared the debug issuem Ian, thanks, and I now have a server directory listing!! - but I am still a little in the dark!

I had referenced system.net at the outset, but installing the System.Net.FtpClient 1.0.5281.14359 has certainly removed the problem HOWEVER I now have both Imports System.Net
and Imports System.Net.FtpClient in a highlighted font - I cannot find an explanation for the highlighted text.

Do I still need the 'system.net import'?

Onwards and upwards.......
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
Have you referenced the System.Net.dll in your project?
 

mike phillips

Member
Joined
Aug 21, 2015
Messages
7
Programming Experience
5-10
Have you referenced the System.Net.dll in your project?
Ineeds, Sir, as per previous post.

Nowell past the problem with System.Net.FtpClient thnaks to Ian.

Still ike to know the significance of the light and dark fonts.

Imports System.Net
Imports System.Net.FtpClient - both in 'dark' font
Imports System - in 'light' font
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,307
Location
Norway
Programming Experience
10+
Light imports font = used namespace, dark font = unused namespace. If you mouse over the 'dark' import a light bulb appears (a text window should also show 'Imports statement is unnecessary'), from it you can choose fix to remove it.
 

mike phillips

Member
Joined
Aug 21, 2015
Messages
7
Programming Experience
5-10
Light imports font = used namespace, dark font = unused namespace. If you mouse over the 'dark' import a light bulb appears (a text window should also show 'Imports statement is unnecessary'), from it you can choose fix to remove it.
Many thanks - alles klar
 
Top Bottom