|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
FTP(not boring)write a user and password, change directory and download a file? All in a single line? In the DOS window I can do tihs: >FTP system prompts: User? >MyName>open myurl system prompts: Password? >MyPassword >CD MyFolder and I can download a file FROM DOS...>GET MyFile MyLocalAddress >quit Is there a way to do this in a sigle line, so I use SHELL in vb6? Thank you. -- Rick Rick,
Why not put what you've got into a .BAT (batch) file, and then (in a single-line) Shell to the batch file? You may have to use the full synatax, e.g. "cmd32.exe filename.bat" (or whatever it is). Not the prettiest solution but it'd work, I believe. HTH, Robert Show quoteHide quote "Rick" <R***@discussions.microsoft.com> wrote in message news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com... > Is there a Shell command where I can connect to an ftp site > write a user and password, change directory and download a file? > All in a single line? > > In the DOS window I can do tihs: > >>FTP >>open myurl > system prompts: User? >MyName > system prompts: Password? >MyPassword >>CD MyFolder >>GET MyFile MyLocalAddress >>quit > > and I can download a file FROM DOS... > > Is there a way to do this in a sigle line, so I use SHELL in vb6? > > > > Thank you. > -- > Rick Why are you hung up on a single line?
-- Show quoteHide quoteChris Hanscom - Microsoft MVP (VB) Veign's Resource Center http://www.veign.com/vrc_main.asp Veign's Blog http://www.veign.com/blog -- "Rick" <R***@discussions.microsoft.com> wrote in message news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com... > Is there a Shell command where I can connect to an ftp site > write a user and password, change directory and download a file? > All in a single line? > > In the DOS window I can do tihs: > >>FTP >>open myurl > system prompts: User? >MyName > system prompts: Password? >MyPassword >>CD MyFolder >>GET MyFile MyLocalAddress >>quit > > and I can download a file FROM DOS... > > Is there a way to do this in a sigle line, so I use SHELL in vb6? > > > > Thank you. > -- > Rick Well, his name is Rick. ;-)
Show quoteHide quote "Veign" <NOSPAMinveign@veign.com> wrote in message news:%23Fx4WZqTGHA.4520@TK2MSFTNGP10.phx.gbl... > Why are you hung up on a single line? > > -- > Chris Hanscom - Microsoft MVP (VB) > Veign's Resource Center > http://www.veign.com/vrc_main.asp > Veign's Blog > http://www.veign.com/blog > -- > > > "Rick" <R***@discussions.microsoft.com> wrote in message > news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com... > > Is there a Shell command where I can connect to an ftp site > > write a user and password, change directory and download a file? > > All in a single line? > > > > In the DOS window I can do tihs: > > > >>FTP > >>open myurl > > system prompts: User? >MyName > > system prompts: Password? >MyPassword > >>CD MyFolder > >>GET MyFile MyLocalAddress > >>quit > > > > and I can download a file FROM DOS... > > > > Is there a way to do this in a sigle line, so I use SHELL in vb6? > > > > > > > > Thank you. > > -- > > Rick > > >> Why are you hung up on a single line? LOL>> > Well, his name is Rick. ;-) (The REAL) Rick Thanks folks.
Answers: 1. I'm the real Rick. 2. The first problem is that under D.O.S. there is a dialogue, i.e. interaction between the user and the machine. So a batch file won't work. 3. The second problem is that certain machines can't download files, or at least they come corrupted, when I use ftpOCX, Internet Transfer controls or Inet.dll. The reason: They don't have permisssions to use FTP, they have to use http. All of the above work well on the mayority of the machines. I'm thinig of using http instead of FTP. But the only way I could download the files was by the command line ftp, as I explained above. 4. Everthing boils down to hiding the user name and password of the site from the software user. I can't use the Webbrowser control because it leaves a "history" of files behind. How can I avoid this "history"? Now, je, je, I can hang up...:) -- Show quoteHide quoteRick "Rick Rothstein" wrote: > >> Why are you hung up on a single line? > >> > > Well, his name is Rick. ;-) > > LOL > > (The REAL) Rick > > > >> >> Why are you hung up on a single line? Maybe I should have signed myself as>> >> >> > Well, his name is Rick. ;-) >> >> LOL >> >> (The REAL) Rick >> > 1. I'm the real Rick. The real ONE-LINER Rick" I'm the Rick that DRBarkley is referring to due to my penchant for posting one-liner solutions to questions that get asked here in the VB newsgroups. Here is a link that you may find interesting on this... http://groups.google.com/groups?as_q=rothstein&num=100&scoring=r&hl=en&as_epq=&as_oq=one-liner+oneliner&as_eq=&as_ugroup=&as_usubject=&as_uauthors=&lr=&as_drrb=q&as_qdr=&as_mind=1&as_minm=1&as_miny=1981&as_maxd=23&as_maxm=3&as_maxy=2006&safe=off Rick "Rick" <R***@discussions.microsoft.com> wrote in message "The best thing about the Internet is that nobody knows you're really a news:D90BB38F-3114-47B7-8965-5703777D1B53@microsoft.com... > 1. I'm the real Rick. dog." > 2. The first problem is that under D.O.S. there is a dialogue, i.e. I know some implementations of FTP can take a file as input and basically > interaction > between the user and the machine. So a batch file won't work. automate an entire FTP session. Might be worth looking into. But I really recommend you go to http://vbnet.mvps.org and grab one of Randy's FTP samples. Quite simple. Rick wrote:
> 3. The second problem is that certain machines can't download files, This doesn't make any sense. Some machines are prohibited from creating FTP> or at least they > come corrupted, when I use ftpOCX, Internet Transfer controls or > Inet.dll. The reason: > They don't have permisssions to use FTP, they have to use http. > All of the above work well on the mayority of the machines. > > I'm thinig of using http instead of FTP. But the only way I could > download the > files was by the command line ftp, as I explained above. connections, but you can use use FTP.EXE to do so anyway? If FTP.EXE can make a connection, so can you -- via either wininet.dll or wsock32.dll. Perhaps you could be more clear about this seeming contradiction? > 4. Everthing boils down to hiding the user name and password of the I'm sure there's a way to clear the cache, but that's just going way> site from the software user. I can't use the Webbrowser control > because it > leaves > a "history" of files behind. How can I avoid this "history"? overboard. You could also, potentially, open a pipe to the command line, and feed it standard input I suppose. I've never tried it going in that direction, but I have read the stdout. This page might get you thinking: http://www.vb-helper.com/howto_capture_console_stdout.html Later... Karl I was Rick for a while (years ago) until I thought I should be Rich. No one
was willing to pay, so... Now I'm Dick. Dick -- Richard Grier, MVP Hard & Software Author of Visual Basic Programmer's Guide to Serial Communications, Fourth Edition, ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004. See www.hardandsoftware.net for details and contact information. LOL.
-- Show quoteHide quoteChris Hanscom - Microsoft MVP (VB) Veign's Resource Center http://www.veign.com/vrc_main.asp Veign's Blog http://www.veign.com/blog -- "DRBarkley" <David.NOSPAMBarkley@L-3NOSPAMCom.com> wrote in message news:uHtB9gqTGHA.4900@TK2MSFTNGP12.phx.gbl... > Well, his name is Rick. ;-) > > > "Veign" <NOSPAMinveign@veign.com> wrote in message > news:%23Fx4WZqTGHA.4520@TK2MSFTNGP10.phx.gbl... >> Why are you hung up on a single line? >> >> -- >> Chris Hanscom - Microsoft MVP (VB) >> Veign's Resource Center >> http://www.veign.com/vrc_main.asp >> Veign's Blog >> http://www.veign.com/blog >> -- >> >> >> "Rick" <R***@discussions.microsoft.com> wrote in message >> news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com... >> > Is there a Shell command where I can connect to an ftp site >> > write a user and password, change directory and download a file? >> > All in a single line? >> > >> > In the DOS window I can do tihs: >> > >> >>FTP >> >>open myurl >> > system prompts: User? >MyName >> > system prompts: Password? >MyPassword >> >>CD MyFolder >> >>GET MyFile MyLocalAddress >> >>quit >> > >> > and I can download a file FROM DOS... >> > >> > Is there a way to do this in a sigle line, so I use SHELL in vb6? >> > >> > >> > >> > Thank you. >> > -- >> > Rick >> >> > > "DRBarkley" <David.NOSPAMBarkley@L-3NOSPAMCom.com> wrote in message ROTFLMAOnews:uHtB9gqTGHA.4900@TK2MSFTNGP12.phx.gbl > Well, his name is Rick. ;-) > > > "Veign" <NOSPAMinveign@veign.com> wrote in message > news:%23Fx4WZqTGHA.4520@TK2MSFTNGP10.phx.gbl... >> Why are you hung up on a single line? -- Reply to the group so all can participate VB.Net: "Fool me once..."
Show quote
Hide quote
"Rick" <R***@discussions.microsoft.com> wrote in message You can use a scripted FTP session as follows:news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com... > Is there a Shell command where I can connect to an ftp site > write a user and password, change directory and download a file? > All in a single line? > > In the DOS window I can do tihs: > > >FTP > >open myurl > system prompts: User? >MyName > system prompts: Password? >MyPassword > >CD MyFolder > >GET MyFile MyLocalAddress > >quit > > and I can download a file FROM DOS... > > Is there a way to do this in a sigle line, so I use SHELL in vb6? > > > > Thank you. > -- > Rick Dim dblProcessId as Double dblProcessId = Shell("ftp -s:c:\ftpscript.txt myurl", vbHide) And in the script file put the commands in the order you want them to be input, e.g. MyName MyPassword CD MyFolder GET MyFile MyLocalAddress Bye That should do what you need. Cheers, Tony. On Mon, 27 Mar 2006 13:48:26 +0100, "Tony Spratt"
<tony_spr***@hotmail.com> wrote: Show quoteHide quote >You can use a scripted FTP session as follows: I mentioned this in an earlier reply, but the OP had stated earlier he> >Dim dblProcessId as Double > >dblProcessId = Shell("ftp -s:c:\ftpscript.txt myurl", vbHide) > >And in the script file put the commands in the order you want them to be >input, e.g. > >MyName >MyPassword >CD MyFolder >GET MyFile MyLocalAddress >Bye > >That should do what you need. > did not want the user to see the authentication details such as password which via this method are in plain text in the 'script' file.
AND Operator and Currency data type
Convert HTML to text Produktlokalisierung - wie funktioniert's? Consume Web Map Service (WMS) with VB6 "Save As" question & file extensions Obtain MCSE certificaiton without exams(Pay after check results)100% passing gaurantee Adding treeview programacticlly Refactoring add-in Syntax Error - Missing Operator - When Using Date ! Will a P&D packaged DLL (DLLSelfRegister) be registered correctly on all OS's? |
|||||||||||||||||||||||