Topic "SYNC VB.NET"

Author Message
Donald
[View user's profile]

Joined: 2016-06-09
Posts: 3
first thanks for all the things you do for all the ppl

i wan't to sync from REMOTE to Local folder

the time stamps (files) of the remote must always be the same as local

because file's are changes @ startup of the program and things can be alternt so the time stamps of the LOCAL are newer than REMOTE so SYNC thosent work because Local is newer, SIZE is not readble because thare is a small change (one letter is changest to a other but the size those not change LOGIC )

so SYNC only files that are changes on the LOCAL DIFFERTN TIME stamps as REMOTE

can be done i think Razz but how do i program this in VB.NET
greats
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
If I understand your question correctly you want to copy all remote files that have different timestamps than local files, no matter if they are newer or older, correct?

Then you need to set the mirror parameter to true.
https://winscp.net/eng/docs/library_session_synchronizedirectories#mirror
Donald
[View user's profile]

Joined: 2016-06-09
Posts: 3
martin wrote:
If I understand your question correctly you want to copy all remote files that have different timestamps than local files, no matter if they are newer or older, correct?

Then you need to set the mirror parameter to true.
https://winscp.net/eng/docs/library_session_synchronizedirectories#mirror
\


that is true thx for replaying

that is exacly what i need but how do i put that in de code can you give a example i have tryed everyting

this i what i have :

Dim SynchronizationResult As SynchronizationResult
SynchronizationResult =
session.SynchronizeDirectories(
SynchronizationMode.Local, "My.Settings.DATA", "/Auto.Sync.Database/", False)

that works but now i need to MIRROR where the put it
searching my *** of on google but i can not find anything where to put the parameter function to mirror Sad sorry i think it is pritty easy but if you not know where to put it Sad i can search forever

Public Function SynchronizeDirectories(mode As SynchronizationMode, localPath As String, remotePath As String, removeFiles As Boolean, Optional mirror as Boolean = False, Optional criteria As SynchronizationCriteria = SynchronizationCriteria.Time, Optional options As TransferOptions = Nothing) As SynchronizationResult

that i know
but dunno what AS boolean mean .. i prity new to VB.net scripten so plsss HELP

thx in return

i got it fixed

Dim localpath As String
localpath = My.Settings.DATA
Dim remotepath As String
remotepath = ("/AutoSyncDatabase/")
Dim mirror As Boolean
mirror = True
Dim SynchronizationCriteria As SynchronizationCriteria
SynchronizationCriteria = 0
Dim SynchronizationResult As SynchronizationResult
SynchronizationResult =
session.SynchronizeDirectories(
SynchronizationMode.Local, localpath, remotepath, mirror, True)

can you look at the code and say if this is the way it should work ore can i make it shorter to run faster Razz

ore the short version :$
Dim mirror As Boolean
mirror = True
Dim SynchronizationResult As SynchronizationResult
SynchronizationResult =
session.SynchronizeDirectories(
SynchronizationMode.Local, My.Settings.DATA, "/AutoSyncDatabase/", mirror, True)

greats
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Correct is:

session.SynchronizeDirectories(SynchronizationMode.Local, localpath, remotepath, True)
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License