Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.9k views
in .NET FTP by (600 points)
I pretty much got this figured out I think but when I connect and send:
eFTPConnection.CreateDirectory("New Folder")
I get the following error
Object reference not set to an instance of an object.
I dont know if its my server or the createDirectory method
The above error is usually looking for a new instance I think however I connnect fresh everytime and close the connection. I tried creating a string variable, I tried eliminating the space between the words. Any Ideas?

3 Answers

0 votes
by (162k points)
Please post a small amount of code illustrating what you are doing.
0 votes
by (600 points)
Cursor = Cursors.WaitCursor
Try
With eFTPConnection
' Set up connection properties
.ServerAddress = txtServer.Text
.UserName = txtUsername.Text
.Password = txtPassword.Text
' Connect to the server
.Connect()
End With

If Not eFTPConnection.IsConnected Then Exit Sub
ClearListViews()
eFTPConnection.GetWorkingDirectory()
Dim NewFolder As String = "New Folder"
eFTPConnection.CreateDirectory(NewFolder)
'Get Fles connects to the server and retrieves files and folders which works ok I use the sub 'procedure to reduce code
GetFiles()
eFTPConnection.Close()
Catch ex As Exception
Me.txtResponse.Text = ex.Message
End Try
Cursor = Cursors.Default
0 votes
by (600 points)
Thanks but I solved the issue it was looking for the new keyword:

eFTPConnection = New FTPConnection

Categories

...