C# using .NET assembly not logging onto site but WinSCP Windows app is logging on

Advertisement

alharlow
Joined:
Posts:
6
Location:
Lincoln, NE USA

C# using .NET assembly not logging onto site but WinSCP Windows app is logging on

I have a C# program that uses the WinSCP .NET assembly. I can see in the assembly log below in section 4 that it never asks for or receives the password from the SessionOptions object in the C# program. The next line after the USER: xxxxxx is "530 Not logged in, need secure connection". But... I am able to log on manually through WinSCP Windows app. The attached log file from that session is in the attached file. The odd thing about logging on manually, even though there is a profile for the connection stored in the WinSCP Windows app (with the password) it stops and asks me to type in the password. So both batch and manual processes have a hiccup at or near the password. The batch process fails, the manual process works fine.
If anyone can take a look at this log and the attached it would be much appreciated
. 2024-02-19 13:45:07.081 WinSCP Version 5.13.6 (Build 9061) (OS 10.0.22621 - Windows 10 Enterprise)
. 2024-02-19 13:45:07.081 Configuration: nul
. 2024-02-19 13:45:07.081 Log level: Normal
. 2024-02-19 13:45:07.081 Local account: REMOTE-LAT-11\AHarlow
. 2024-02-19 13:45:07.081 Working directory: C:\McLeodProjects\FuelCard\PriceSheetsCmd\PriceSheetsCmd\bin\Debug
. 2024-02-19 13:45:07.081 Process ID: 15688
. 2024-02-19 13:45:07.081 Command-line: "C:\McLeodProjects\FuelCard\PriceSheetsCmd\PriceSheetsCmd\bin\Debug\winscp.exe" /xmllog="C:\Users\AHarlow\AppData\Local\Temp\wscp28A0.013965FA.tmp" /xmlgroups /xmllogrequired /nointeractiveinput /dotnet=5.13.6  /ini=nul /log="c:\AKH\WinSCP.log"  /console /consoleinstance=_10400_50632145_349
. 2024-02-19 13:45:07.081 Time zone: Current: GMT-6, Standard: GMT-6 (Central Standard Time), DST: GMT-5 (Central Daylight Time), DST Start: 3/10/2024, DST End: 11/3/2024
. 2024-02-19 13:45:07.081 Login time: Monday, February 19, 2024 1:45:07 PM
. 2024-02-19 13:45:07.081 --------------------------------------------------------------------------
. 2024-02-19 13:45:07.081 Script: Retrospectively logging previous script records:
> 2024-02-19 13:45:07.081 Script: option batch on
< 2024-02-19 13:45:07.081 Script: batch           on        
< 2024-02-19 13:45:07.081 Script: reconnecttime   120       
> 2024-02-19 13:45:07.081 Script: option confirm off
< 2024-02-19 13:45:07.081 Script: confirm         off       
> 2024-02-19 13:45:07.081 Script: option reconnecttime 120
< 2024-02-19 13:45:07.081 Script: reconnecttime   120       
> 2024-02-19 13:45:07.081 Script: open ftp://xxxxxxx2:***@files.xxxxxxxx.net -passive=1 -timeout=15
. 2024-02-19 13:45:07.081 --------------------------------------------------------------------------
. 2024-02-19 13:45:07.081 Session name: xxxxxxx2@files.xxxxxxxx.net (Ad-Hoc site)
. 2024-02-19 13:45:07.081 Host name: files.xxxxxxxx.net (Port: 21)
. 2024-02-19 13:45:07.081 User name: xxxxxxx2 (Password: Yes, Key file: No, Passphrase: No)
. 2024-02-19 13:45:07.081 Transfer Protocol: FTP
. 2024-02-19 13:45:07.081 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2024-02-19 13:45:07.081 Disable Nagle: No
. 2024-02-19 13:45:07.081 Proxy: None
. 2024-02-19 13:45:07.081 Send buffer: 262144
. 2024-02-19 13:45:07.081 UTF: Auto
. 2024-02-19 13:45:07.081 FTPS: None [Client certificate: No]
. 2024-02-19 13:45:07.081 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2024-02-19 13:45:07.081 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2024-02-19 13:45:07.081 Cache directory changes: Yes, Permanent: Yes
. 2024-02-19 13:45:07.081 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2024-02-19 13:45:07.081 Timezone offset: 0h 0m
. 2024-02-19 13:45:07.081 --------------------------------------------------------------------------
. 2024-02-19 13:45:07.081 Connecting to files.xxxxxxxx.net ...
. 2024-02-19 13:45:07.128 Connected with files.xxxxxxxx.net. Waiting for welcome message...
< 2024-02-19 13:45:07.159 220 Serv-U FTP Server v15.3.2 ready...
> 2024-02-19 13:45:07.159 USER xxxxxxx2
< 2024-02-19 13:45:07.206 530 Not logged in, need secure connection.
. 2024-02-19 13:45:07.206 Connection failed.

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,440
Location:
Prague, Czechia

Re: C# using .NET assembly not logging onto site but WinSCP Windows app is logging on

The server requires encrypted connection. You need to use SessionOptions.FtpSecure property:
https://winscp.net/eng/docs/library_sessionoptions#ftpsecure
Or have your GUI generate full code template for you:
https://winscp.net/eng/docs/ui_generateurl#code

If you need help with your GUI password problem, please post GUI log file.

Reply with quote

Advertisement

You can post new topics in this forum