سلام خدمت اساتید من یک سورس می خوام که با اون بتونم عکس upload کنم به ftp لطفا کنی اگر سورسی هست امتحان کنید بد بزاری برای دانلود
سلام خدمت اساتید من یک سورس می خوام که با اون بتونم عکس upload کنم به ftp لطفا کنی اگر سورسی هست امتحان کنید بد بزاری برای دانلود
با سلام!
دوست عزیز عضویت شما رو در PCN تبریک می گم!
کد آپلود فایل با FTP:
Add Five Label Controls
Caption for Five Label controls:Host, User Name, Password, Local File, Remote File
Add Six Text Box Controls
Name as : txtHost,
txtUserName,
txtPassword :
Property -> Password Char=*,
txtLocalFile,
txtRemoteFile,
txtResults :
Property -> Multi Line=True,
Scroll Bars=2-Vertical
Add One INet Control:
Name as : inetFTP
Private m_GettingDir As Boolean
Private Sub AddMessage(ByVal msg As String)
txtResults.Text = txtResults.Text & vbCrLf & msg
txtResults.SelStart = Len(txtResults.Text)
End Sub
Private Sub cmdDownload_Click()
Dim host_name As String
Enabled = False
MousePointer = vbHourglass
txtResults.Text = "Working"
txtResults.SelStart = Len(txtResults.Text)
DoEvents
' You must set the URL before the user name and
' password. Otherwise the control cannot verify
' the user name and password and you get the error:
'
' Unable to connect to remote host
host_name = txtHost.Text
If LCase$(Left$(host_name, 6)) <> "ftp://" Then host_name = "ftp://" & host_name
inetFTP.URL = host_name
inetFTP.UserName = txtUserName.Text
inetFTP.Password = txtPassword.Text
' Do not include the host name here. That will make
' the control try to use its default user name and
' password and you'll get the error again.
inetFTP.Execute , "Get " & _
txtRemoteFile.Text & " " & txtLocalFile.Text
' m_GettingDir = True
' inetFTP.Execute , "Dir"
End Sub
Private Sub cmdUpload_Click()
Dim host_name As String
Enabled = False
MousePointer = vbHourglass
txtResults.Text = "Working"
txtResults.SelStart = Len(txtResults.Text)
DoEvents
' You must set the URL before the user name and
' password. Otherwise the control cannot verify
' the user name and password and you get the error:
'
' Unable to connect to remote host
host_name = txtHost.Text
If LCase$(Left$(host_name, 6)) <> "ftp://" Then host_name = "ftp://" & host_name
inetFTP.URL = host_name
inetFTP.UserName = txtUserName.Text
inetFTP.Password = txtPassword.Text
' Do not include the host name here. That will make
' the control try to use its default user name and
' password and you'll get the error again.
inetFTP.Execute , "Put " & _
txtLocalFile.Text & " " & txtRemoteFile.Text
' m_GettingDir = True
' inetFTP.Execute , "Dir"
End Sub
Private Sub inetFTP_StateChanged(ByVal State As Integer)
Select Case State
Case icError
AddMessage "Error: " & _
" " & inetFTP.ResponseCode & vbCrLf & _
" " & inetFTP.ResponseInfo
Case icNone
AddMessage "None"
Case icConnecting
AddMessage "Connecting"
Case icConnected
AddMessage "Connected"
Case icDisconnecting
AddMessage "Disconnecting"
Case icDisconnected
AddMessage "Disconnected"
Case icRequestSent
AddMessage "Request Sent"
Case icRequesting
AddMessage "Requesting"
Case icReceivingResponse
AddMessage "Receiving Response"
Case icRequestSent
AddMessage "Request Sent"
Case icResponseReceived
AddMessage "Response Received"
Case icResolvingHost
AddMessage "Resolving Host"
Case icHostResolved
AddMessage "Host Resolved"
Case icResponseCompleted
AddMessage inetFTP.ResponseInfo
If m_GettingDir Then
Dim txt As String
Dim chunk As Variant
m_GettingDir = False
' Get the first chunk.
chunk = inetFTP.GetChunk(1024, icString)
DoEvents
Do While Len(chunk) > 0
txt = txt & chunk
chunk = inetFTP.GetChunk(1024, icString)
DoEvents
Loop
AddMessage "----------"
AddMessage txt
End If
Case Else
AddMessage "State = " & Format$(State)
End Select
Enabled = True
MousePointer = vbDefault
End Sub
منبع (Only the registered members can see the link)
سورس vb6 استفاده از ftp.exe در آپلود فایل (Only the registered members can see the link)
اطلاعات بیش تر (Only the registered members can see the link)
یک سورس کامل برای FTP در VB6 (Only the registered members can see the link)
دوست عزیز! متاسفانه من سرم خیلی شلوغه؛ برای همین کد ها رو امتحان نکردم. خودتون یه امتحان کنید، ضرری نداره.
این جا هم یه سورس Http Upload هستش که شاید کمکتون کنه:
Only the registered members can see the link
با سپاس
آرمین:11():
با سلام!
یک سری از OCX ها برای کار با FTP که متاسفانه رایگان نیستند:
CHILKAT FTP2 (Only the registered members can see the link)
نمونه کد (Only the registered members can see the link)
1.1 مگابایت
فایل MSI برای نصب
لینک مستقیم
Easy FTP DLL (Only the registered members can see the link)
Only the registered members can see the link (Only the registered members can see the link)
1.8 مگابایت
لینک مستقیم
FREE Trial of FTP for ActiveX (Only the registered members can see the link)
PowerTCP for ActiveX
4.2 مگابایت
لینک مستقیم
با سپاس
آرمین:11():