Hi,
I am trying to transfer a specific file between a Win95 PC and a HP-UX machine running unix. The process should be running in the background withour any intervention from the user.
Any help is very much appreciated.
Thank
Printable View
Hi,
I am trying to transfer a specific file between a Win95 PC and a HP-UX machine running unix. The process should be running in the background withour any intervention from the user.
Any help is very much appreciated.
Thank
If you have IE3 or later installed on the machine, you can use my code from :
http://codeguru.developer.com/vb/articles/1852.shtml.
The code is contained in a class module you can simply drop into your project and use straight away.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Hi Chris,
Thank for the tip. I've downloaded the sample but could not load the project. I am getting the 'Retained' is an invalid key error.
Pls help.
That's because it was written in VB6. You'll need to remove the first 3 lines at the top of the Class module (before the Option Explicit).
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Hi Chris,
Thank you for the tip. In your cFTP.cls module you call a REPLACE() function, but there is no REPLACE() function in your class or form module.
Pls help.
I forgot about that - I don't think there's any other VB6 code in the project, but this VB5 code can be used to replace 'Replace' :
public Sub ReplaceAll(byref sOrigStr as string, _
byval sFindStr as string, _
byval sReplaceWithStr as string, _
optional bWholeWordsOnly as Boolean)
'
' Replaces all occurances of sFindStr with sReplaceWithStr
'
Dim lPos as Long
Dim lPos2 as Long
Dim sTmpStr as string
Dim bReplaceIt as Boolean
Dim lFindStr as Long
on error GoTo vbErrorHandler
lFindStr = len(sFindStr)
lPos2 = 1
bReplaceIt = true
sTmpStr = sOrigStr
Do
lPos = InStr(lPos2, sOrigStr, sFindStr)
If lPos = 0 then
Exit Do
End If
If bWholeWordsOnly then
on error resume next
If lPos = 1 Or (mid$(sOrigStr, lPos - 1, 1) = " ") then
If (mid$(sOrigStr, lPos + lFindStr, 1) = " ") Or mid$(sOrigStr, lPos + lFindStr + 1, 1) = "" then
bReplaceIt = true
else
bReplaceIt = false
End If
End If
End If
If bReplaceIt then
If lPos > 1 then
sTmpStr = Left$(sOrigStr, lPos - 1)
else
sTmpStr = ""
End If
sTmpStr = sTmpStr & sReplaceWithStr
sTmpStr = sTmpStr & mid$(sOrigStr, lPos + lFindStr, len(sOrigStr) - (lPos + lFindStr - 1))
sOrigStr = sTmpStr
End If
lPos2 = lPos + 1
Loop
sOrigStr = sTmpStr
Exit Sub
vbErrorHandler:
Err.Raise Err.Number, "ReplaceAll", Err.Description
End Sub
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Hi,
Can anybody give me a sample of how to transfer a file ie using FTP but WITHOUT overwriting it. The current FtpPutFile() will overwrite the file.
Thank you.
Why dont you just use the VB function Replace()?
--
Chizl
[email protected]
http://www.chizl.com/
My bad.. I have a simpler StringReplace function with less code if you want for VB5
--
Chizl
[email protected]
http://www.chizl.com/
But does it have the 'whole-words only' option like mine ? I'd be interested to see it.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb