Results 1 to 4 of 4

Thread: I can't solve this myself. I need some help here, thankyou

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Nashville, TN
    Posts
    54
    I just posted a question on this about 1 hour ago, I thought I had the problem solved. ANyways I don't here is my problem, If someone could help me, it would be much appreciated.

    I have added Microsoft Internet Transfer Control 6.0
    i added the control. The protocol is set to icFTP.


    I added the following code to a form with a textbox and a button

    --------------------------------------------
    Private Sub Command1_Click()

    Dim tstr As Variant

    Inet1.Protocol = icFTP
    tstr = Inet1.OpenURL("ftp://ftp.cdrom.com")
    text1.Text = tstr

    End Sub
    ----------------------------------------

    for the strangest reason it will not connect. I have tried about 10 different addresses, I also tried other ftp clients and they all connect, so it's not their server. I tried it on 2 other machines, I also redid the code on another machine just to check if my VB install was corrupted. I just can't figure out why it won't connect. any advice


  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Sorry, but it worked OK on my PC
    so did this...
    Code:
    Private Sub Command2_Click()
    Inet1.URL = "FTP://ftp.cdrom.com"
    
    Text1.Text = Inet1.OpenURL
    End Sub
    Mark
    -------------------

  3. #3
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633

    FTP is really crazy.

    Make sense out of this. Chris Carterson gave me this code.
    _________________________________________________________

    Option Explicit

    Private Sub Form_Load()
    'PURPOSE:Initialize
    txtServer.Text = "ftp.midwinter.com"
    txtPass.Text = "[email protected]"
    txtUser.Text = "anonymous"
    txtSource.Text = "/pub/TV/Lois-and-Clark/bond4.jpg"
    txtDestination.Text = "c:\bond4.jpg"
    txtTimeout.Text = "30"
    End Sub

    Private Sub cmdGet_Click()
    If IsInputValid = True Then
    Me.FtpGet Me.txtSource, Me.txtDestination, Me.txtUser, Me.txtPass, Me.txtServer, Me.txtTimeout
    End If
    End Sub
    Public Function FtpGet(ByVal strSource As String, ByVal strDestination As String, ByVal strUser As String, ByVal strPass As String, ByVal strServer As String, Optional ByVal Timeout As String = "5") As Boolean
    'PURPOSE:If time is blank then default to 5 seconds
    Dim intTimeOut As Integer
    If Trim(Timeout) <> "" Then
    If IsNumeric(Timeout) Then
    intTimeOut = CInt(Timeout)
    End If
    Else
    intTimeOut = 5
    End If

    'PURPOSE:Grab the file
    cmdGet.Enabled = False
    InetFtp.Cancel

    On Error Resume Next
    With InetFtp
    .URL = "ftp://" & strServer
    .UserName = strUser
    .Password = strPass
    .RequestTimeout = intTimeOut
    .Execute , "GET " & strSource & " " & strDestination
    '.Execute "PUT " & strSource & " " & strDestination

    Do While .StillExecuting <> 0
    DoEvents
    Loop
    End With
    cmdGet.Enabled = True
    End Function

    Private Function IsInputValid() As Boolean
    'PURPOSE:Check for blanks
    Dim ctl As Control
    For Each ctl In Me.Controls
    If TypeOf ctl Is TextBox Then
    If InStr(LCase$(ctl.Name), "timeout") = 0 Then
    If Trim$(ctl.Text) = "" Then
    MsgBox "Timeout is the only optional field. Please make sure all other fields are complete and try again.", vbExclamation, "Required field not filled in"
    IsInputValid = False
    Exit Function
    End If
    End If
    End If
    Next
    ' if you got this far all required fields are filled
    IsInputValid = True
    End Function
    Chemically Formulated As:
    Dr. Nitro

  4. #4
    Guest
    Let me ask just one question, do you have any kinda firewall, proxy server or anything like that running?? on your computer or on the ISP computer?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width