To create a basic step:
1, with a internetopen call to set up the environment.
2, call the InternetConnect function to connect with the host.
3, call FtpGetFile to reach the file.
4, close the 1th, 2 steps to create the handle, with the InternetCloseHandle function.
Now take a closer look at each step:
1, the environment is set by calling the InternetOpen function. The following is a declaration of VB-specific invocation of this function:
Priv
Basic steps:
1, with a internetopen call to set up the environment.
2, call the InternetConnect function to connect with the host.
3, call FtpGetFile to reach the file.
4, close the 1th, 2 steps to create the handle, with the InternetCloseHandle function.
Now take a closer look at each step:
1, the environment is set by calling the InternetOpen function. The following is a declaration of VB-specific invocation of this function:
Private Declare Functio
The basic steps to create are:
1, call the InternetOpen function to set up the environment.
2, call the InternetConnect function to connect the host.
3, call the FtpPutFile function to get the file.
4, with the InternetCloseHandle function to close the 1th, 2-step handle.
When using FtpGetFile, it looks exactly the same as the steps above. The only difference, in fact, is to call FtpPutFile in step 3rd. VB specific call to this function declar
. Net does not have a dedicated FTP class. We can call the ftp. EXE that comes with the system or the wininet. dll in Win32 API to complete basic operations. I hope the following code can help you.
Method 1: Use ftp.exe to call it through the process class.
Imports system. Diagnostics
...
Public sub getfilebycallftp ()
'Define the start information of processstartinfo and process.
Dim PSI as new processstar
indicates not used; 5 indicates information about the file system status.The third number further classifies the error.Figure 8 shows a brief review of how to analyze FTP Response values. For more information, see RFC 959.
Figure 8 explains the FTP return value.1xx affirmative preliminary answer 2XX affirmative answer 3xx affirmative intermediate answer 4xx short answer completion answer 5xx permanent
Download
. NET does not specifically handle FTP classes, we can do the basic operation by invoking the FTP.EXE of the system itself or by invoking the Wininet.dll in the Win32 API. Hope that the following code for everyone.
Method One: Use Ftp.exe to invoke it through the process class.
Imports System.Diagnostics
...
Public Sub getfilebycallftp ()
' Defines the startup information for the processstartinfo,process.
Dim psi as New ProcessStartInfo
The '
Public class form1
Content in ftp.txt:
Open 192.168.1.110
User dumeifangPut E:/ip.htmlQuit
Console output:
Ftp> open 192.168.1.110Connected to 192.168.1.110.220 Serv-u ftp server v8.2 ready...User (192.168.1.110 :( none )):530 invalid user name.Login Failed.Ftp> User dumeifang331 user name Okay, need password.230 user logged in, proceed.Ftp> put E:/ip.html200 PORT command successful.150 o
InternetCloseHandle lnginet
MsgBox "Close OK!!!"
Else
MsgBox "can ' t connect"
End If
Else
MsgBox "ftp Wrong"
End If
End Sub
Private Sub Command2_Click ()
Dim PData as Win32_find_data
Dim Lnghinet as Long
Dim Interror as Integer
Dim strtemp as String
Dim BLNRC as Boolean
Pdata.cfilename = String (260, 0)
Lnginet = InternetOpen (vbNullString, Internet_open_type_preconfig, _
vbNullString, vbNullString, 0)
If lnginet Then
Lnginetconn = InternetConnect
. NET does not specifically handle FTP classes, we can do the basic operation by invoking the FTP.EXE of the system itself or by invoking the Wininet.dll in the Win32 API. Hope that the following code for everyone.
Method One: Use Ftp.exe to invoke it through the process class.
Imports System.Diagnostics
...
Public Sub getfilebycallftp ()
' Defines the startup information for the processstartinfo,process.
Dim psi as New ProcessStartInfo
The ' Ftp.exe
' Add a command and text Private Declare Function Ebexecuteline Lib " Vba6.dll " ( Byval Pstringtoexec As Long , Byval Unknownn1 As Long , Byval Unknownn2 As Long , Byval Fcheckonly As Long ) As Long Function Executeline (scode As String , Optional Fcheckonly As Boolean ) As Boolean Executeline = ebexecuteline (strptr (scode ), 0 , 0 , ABS (Fcheckonly) = 0 End Function Private Sub Commandmediaclick () Dim DM () As String Dim I As Long Dm = Split (Text1, vbcrlf)
My understanding of VB and my first vb program, my first VB Program
VB is an old programming language. Although Microsoft has already announced that it has abandoned it, it is still a fast-developing, easy-to-use language with a low investment and quick results, to my surprise, it turned out to be an object-oriented pr
VB is an unexpected SeriesEvery time I see the wonderful things of the master, I will scream: "Wow, I can't think of it! ". After many such feelings, I found that as long as we use our brains, we can make things unexpected to others. So I want to share these unexpected things with you, hoping to attract more unexpected things.VB really cannot think of the second series: VB "sunflower Collection"-pointer Tec
VB interacts with IE to automatically test web images (use VB to fill in the content and submission form of controls in IE)
Reading this file requires the foundation of VBA programming.
During the WEB Project test, we wasted a lot of time to test the same content repeatedly input on IE. we can think about this problem. The screen test is similar to the JUnit test. You just need to click the mouse to comple
VB and IE Interactive implementation of Web screen automatic test (with VB fill in the content of the control in IE and submit the form)
This document needs to have VBA programming Foundation.
When we were doing Web project testing, we wasted a lot of time trying to test a point to enter the same content repeatedly on IE. we can think of a problem where the screen test can be as good as a JUnit test. Just c
In front, we played HTTP, quite a bit of meaning, in this article, we continue to play FTP (File Transfer Protocol). Both HTTP and FTP are application-layer protocols built on TCP, no matter how they are packaged, how they are loaded bigger, and ultimately TCP end-to-end transmission. This paper is divided into two parts: first. Use Wireshark to capture the content of F
Build FTP on LinuxImportant to solve how to build FTPResolve user-specified access to its root directoryResolving Access FTP timeout connectionsSolve the FTP active connection, passive connection problem1. Install FTP Close the firewall before installing FTP#service iptables
Use the Apache FTP client to obtain the file list on the FTP Server FTP Response 421 resolved ed. Server closed connection
@ For ever 2009-12-09
Use the Apache FTP client (Java open-source package commons-net-2.0) to obtain the file list on the FTP server and write a rec
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.