Results 1 to 7 of 7

Thread: 'FtpClient' is not defined

  1. #1
    mike phillips is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Aug 2015
    Posts
    7
    Reputation
    0

    'FtpClient' is not defined

    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.

  2. #2
    IanRyder is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Sep 2012
    Location
    Healing, NE Lincs, UK
    Posts
    1,128
    Reputation
    743
    Hi,

    It sounds like you have not referenced the Assembly file so have a look at this to see if this helps to get you started:-

    System.Net.FtpClient

    Hope that helps.

    Cheers,

    Ian

  3. #3
    mike phillips is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Aug 2015
    Posts
    7
    Reputation
    0
    Quote Originally Posted by IanRyder View Post
    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.......

  4. #4
    JuggaloBrotha's Avatar
    JuggaloBrotha is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Jun 2004
    Location
    Lansing, MI; USA
    Posts
    4,464
    Reputation
    1015
    Have you referenced the System.Net.dll in your project?
    Currently using: VS 2010 Ultimate on Win7 Ultimate x64.

  5. #5
    mike phillips is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Aug 2015
    Posts
    7
    Reputation
    0
    Quote Originally Posted by JuggaloBrotha View Post
    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

  6. #6
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,080
    Reputation
    2802
    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.

  7. #7
    mike phillips is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Aug 2015
    Posts
    7
    Reputation
    0
    Quote Originally Posted by JohnH View Post
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •