Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Help with the code filter_list
Author
Message
Help with the code #1
Hi, i found this thread on this forum LINK, I wanted to use it to my program, i copy and paste it for test. It's good but when i copy url with http://
i have this error[Image: ivdw.jpg] I translate the error because it is in polish
"cannot convert prompt argument to string type". Can anyone help me with this error? Please be patient, i'm begginnerSmile

Reply

RE: Help with the code #2
The MsgBox needs a string. So you can't give it an Exception, because that's not a string. You probably want to get the message string of the Exception first.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Help with the code #3
Ok, can you help me with fix that problem, i'm only begginerSmile I make this with the code and now i have a different error [Image: iapw.jpg]

Reply

RE: Help with the code #4
shouldn't it be ex.message?

[edit] I think Nieznany mean "Unknown"
Do you want me to explain the whole exception message?

[edit] Sorry I thought you were asking for the translation (I didn't see it), apologies!

Try ex.message first, and ... try this:

Code:
if TextBox1.Text.Contains("http://") Then
   Dim entry As String = TextBox1.Text.Replace("http://", "").Trim()
   Dim iphe As IPHostEntry = Dns.GetHostEntry(entry)
   ...
[Image: wvBFmA5.png]

Reply

RE: Help with the code #5
Thanks Ligeti, your answer is very helpful. Now my code lokking like this
Code:
Imports System.Net


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            If TextBox1.Text.Contains("http://") Then
                Dim iphe As IPHostEntry = Dns.GetHostEntry(TextBox1.Text.Replace("http://", "").Trim())
                TextBox2.Text = iphe.AddressList(0).ToString()

            ElseIf TextBox1.Text.Contains("https://") Then
                Dim iphe As IPHostEntry = Dns.GetHostEntry(TextBox1.Text.Replace("https://", "").Trim())
                TextBox2.Text = iphe.AddressList(0).ToString()

            Else
                Dim iphe As IPHostEntry = Dns.GetHostEntry(TextBox1.Text)
                TextBox2.Text = iphe.AddressList(0).ToString()
            End If


        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub


End Class

And it's good. Maybe notSad One little problem, if i paste URL like this https://www.something.com there is ok but like this http://www.something.com/ it's not ok. This "/" is the problem, how can i add '/' to list of exceptions. I tried like this [Image: pp48.jpg]:) and that's not working

Reply

RE: Help with the code #6
You're welcome :-)

use regular expression, that will solve all you problems!
[Image: wvBFmA5.png]

Reply

RE: Help with the code #7
OkSmile Thanks for help. Can you recommend me some tutorials of vb.net for totally beginners??

Reply

RE: Help with the code #8
Of course, first try: http://www.hackcommunity.com/Forum-Visua...ork-Family there are some very good VB threads there!

I personally don't program in VB, in fact this i maybe the second time in my life that I write a code in VB lol, I know C# ... but I am a Linux guy.

You can also try:
http://www.dotnetperls.com/vb, I like the design of that website! And it has some great topics about .NET

And as for Regular Expression I highly recommend that you use Expresso: http://www.ultrapico.com/expresso.htm, it is a great tool to test regular expressions.

Happy coding and good luck Smile
[Image: wvBFmA5.png]

Reply

RE: Help with the code #9
Thank you very muchSmileOoooo, the link to ultrapico is not working, dotnetperls tooSad

Reply

RE: Help with the code #10
(02-12-2014, 07:12 PM)zibi860810 Wrote: Thank you very muchSmileOoooo, the link to ultrapico is not working, dotnetperls tooSad

It's because the comma (,) got included with the url just remove it from the address bar and try again
If you need help feel free to PM me
[Image: klfpJD]
Probitcoin
Freebitcoin
BTC clicks
bitcoin wallet:
1FBPAanbs3rJU9BUpobpDJc9hHUaCaC25N

Reply







Users browsing this thread: 1 Guest(s)