2 Replies - 1325 Views - Last Post: 09 October 2012 - 11:47 PM Rate Topic: -----

#1 Bless841  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 14-January 11

Error when connecting to remote server

Posted 09 October 2012 - 05:45 AM

Hi,

Please assist. I get error msg "Logon Failure : Unknown user name or bad password" but the credentials I have supplied are correct

code:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim strdomainname, strusername, strpassword, strremoteServerName As String
        Dim password As New Security.SecureString
        Dim command As New Process

        strremoteServerName = "196.10.15.151"
        strusername = "secretftp"
        strpassword = "secptptf"
        strdomainname = ftp.mansk.co.za

        For Each strchar As Char In strpassword.ToCharArray
           password.AppendChar(strchar)
        Next

        Dim impersonator As New AliasAccount(strusername, strpassword)

        command.StartInfo.FileName = "201210091530_3618.txt"
        command.StartInfo.Arguments = "\\" & strremoteServerName & "\Minnes\done"

        command.StartInfo.UserName = strusername
        command.StartInfo.Password = password
        command.StartInfo.Domain = strdomainname

        command.StartInfo.Verb = "open"
        command.StartInfo.UseShellExecute = False
        impersonator.BeginImpersonation()
        command.Start()
        impersonator.EndImpersonation()
End sub



Is This A Good Question/Topic? 0
  • +

Replies To: Error when connecting to remote server

#2 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 221
  • View blog
  • Posts: 1,478
  • Joined: 16-March 11

Re: Error when connecting to remote server

Posted 09 October 2012 - 08:46 AM

Alright place a break point, and start going through your code. Debugging is your job, not ours. We will help you if you find a specific issue that you do not know how to over come. This is a pretty broad error. Simply telling us "I got an error" doesn't help anyone.
Was This Post Helpful? 0
  • +
  • -

#3 Bless841  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 14-January 11

Re: Error when connecting to remote server

Posted 09 October 2012 - 11:47 PM

Hi,

Thanks for your reply. I did that i get an error here:
command.Start()

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1