Jump to content

Need Some General VB6 Help Please.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Skel

Skel

    Learning Programmer

  • Members
  • PipPipPip
  • 33 posts
I'm trying to gather the data from a file which i have on my computer, and compare it to a file which i have saved on my website.

The website is successfully found, and read by making a label's caption change to what it in the file on the website.

Each line of the file on my computer is being read, i made it messageBox each line (Not in the code atm)

It either doesn't compare the files correctly or....i don't even know.

The code i'm using is below, i have a commondiologue control named 'CD1' and the inet control if you want to test it. (You also have to have things named the same)

Thanks for any help i can get!

Dim Implist As String

Dim list As String

Dim found As Boolean


Private Sub cmdOpenCheck_Click()

If cmdOpenCheck.Caption = "Open MSN List" Then

CD1.ShowOpen

txtDir.Text = CD1.FileName


ElseIf cmdOpenCheck.Caption = "Check For Impostors" Then


    Open txtDir.Text For Input As #1

    Do While Not EOF(1)

    Line Input #1, list

       

    If InStr(1, list, Implist) = True Then

       found = True

    Else: found = False

    End If

    

    Loop

    Close #1

    

If found = True Then

    MsgBox "The thing has been found" & list

    

ElseIf found = False Then

    MsgBox "the thing has NOT been found"

    Unload Me

    End

    

End If


End If


End Sub


Private Sub Form_Load()

CD1.Filter = "*.ctt | *.ctt"

Implist = Inet1.OpenURL("www.example.com/list.txt")

Label1.Caption = Implist 'This shows that it's gathering the data from above

End Sub


#2
jashsayani

jashsayani

    Learning Programmer

  • Members
  • PipPipPip
  • 41 posts
Does your website allow the program to access the file..? Because sometimes the web-server does not allow accessing files, and Directory listing is prohibited.

#3
Skel

Skel

    Learning Programmer

  • Members
  • PipPipPip
  • 33 posts
Oops, i figured out the problem and forgot to edit this.

Someone can close it :)

#4
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
No need to close it. Would you mind posting the solution please?

#5
Skel

Skel

    Learning Programmer

  • Members
  • PipPipPip
  • 33 posts
Don't know if you'll understand what it's for/what it does, but sure :)

Attached Files