|
-
Aug 25th, 2000, 08:47 AM
#1
Thread Starter
Hyperactive Member
I have the following code, but am unable to figure out how to put my appropriate strings within the quotations effectively.
Code:
Private Sub cmdSend_Click()
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT C:\Program Files\Test.txt Test.txt"
End With
End Sub
I want to put string variables in the place of the directory path listed. How can I do this and still get the execute command to work?
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 25th, 2000, 08:50 AM
#2
Use triple quotes to enclose it in quotes.
Code:
"""PUT C:\Program Files\Test.txt Test.txt"""
-
Aug 25th, 2000, 08:53 AM
#3
Thread Starter
Hyperactive Member
I mean I want to replace the C:\Program Files\Test.txt with something like Text1.txt, so this would require a string within the quotations it would appear, in order for the .Execute to run correctly.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 25th, 2000, 09:07 AM
#4
_______
<?>
Code:
'it's as Megatron says
Dim helpme As String
helpme = """PUT C:\Program Files\Test\Test.txt Text.txt"""
'for display
MsgBox helpme
example:
.Execute , helpme
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 25th, 2000, 09:13 AM
#5
Thread Starter
Hyperactive Member
Maybe it will help clarify here if I show you exactly what I want to do.
Code:
Private Sub cmdSend_Click()
Dim strFileName As String, strFileTitle As String
strFileName = "C:\Program Files\Test.txt
strFileTitle = "Test.txt"
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT ""strFileName""strFileTitle"
End With
End Sub
I appreciate your helping, and hope this clarifys the conflict.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 25th, 2000, 09:26 AM
#6
How about:
Code:
"PUT " & strFileName & " " & strFileTitle
-
Aug 25th, 2000, 09:29 AM
#7
Thread Starter
Hyperactive Member
That renders the following text line:
"PUT " C:\Test.txt Test.txt
It has to look like "PUT C:\Test.txt Test.txt" ultimately.
Thanks for helping me brainstorm this. I had thought that strings that would be inserted inside operational statements would be a cakewalk, but this one is a monster to figure out.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 25th, 2000, 09:33 AM
#8
Thread Starter
Hyperactive Member
In fact to be quite honest, if I need the dir path to be separated text such as C:\Program Files\Test.txt then the operational statement must ultimately look like this...
Code:
.Execute , "PUT ""C:\Program Files\Test.txt""Test.txt"
That Operational line works like a charm every time. But I am not understanding how to do the same operational line by using string variables instead of the actual Names.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 25th, 2000, 09:44 AM
#9
Fanatic Member
Try putting triple quotes around everything.
Option Explicit
Dim strOne As String
Dim strTwo As String
Dim strResult As String
Private Sub Command1_Click()
strOne = "string 1"
strTwo = "string 2"
strResult = """PUT """ & """strone""" & " " & """strtwo"""
MsgBox strResult
End Sub
strResult will contain "PUT ""strone" "strtwo"
-
Aug 25th, 2000, 09:48 AM
#10
New Member
Try:
have a temporary string
strTemp = "PUT " & strFileName & " " & strFileTitle
.execute , strTemp
or failing that try:
strTemp = """ & "PUT " & strFileName & " " & strFileTitle & """
It wins awards for ludicrousy but it might just work...
Give me five lines written by the most honourable of men, and I shall find in them an excuse to hang him. - Cardinal Richelieu
Ben Stappleton
VB6E SP4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|