[HELP]Error

Posts 1–10 of 10 · Page 1 of 1
[HELP]Error
Hey, before few weeks i made my newest My Computer and worked good.

Then, before like a week I ran it and it crashed. Then i redownloaded it from my site; it crashed (it didn't when i made it).

Then i ran my project, just to check what's the matter, and i got that (when i want to debug):


Can anywho help me?

I also got TeamView so if you want to help via it post bellow

Please, help!
I don't know what your program does, but it seems you're connecting to a server or a website, and that server/website is returning an 403 Not found error and you're not handling it.
Change your permissions of that file to 777.

Quote Originally Posted by Erinador View Post
I don't know what your program does, but it seems you're connecting to a server or a website, and that server/website is returning an 403 Not found error and you're not handling it.
404 = File not found
403 = No permission
Aaah, I always mix stuff up.

And btw, why does a My Computer computer need to connect to any website/server.
(Besides the obvious updating stuff)
Quote Originally Posted by Erinador View Post
Aaah, I always mix stuff up.

And btw, why does a My Computer computer need to connect to any website/server.
(Besides the obvious updating stuff)
He wants it to get the IP and the country flag.
Its easy, but the site he is using must have changed something and now he is getting 403 errors.
Quote Originally Posted by JamesA1994 View Post
He wants it to get the IP and the country flag.
Its easy, but the site he is using must have changed something and now he is getting 403 errors.
exatcly. ..
As Erinador said, read the exeception message, means the server must have changed its permissions at some point. An error like that usually means you have a class/global level variable declared that holds a value from a server, so your program tries initializing those variables at the very beginning and if they fuck up, there's your error. Try declaring them empty, and assigning their values during Form_Load within a try-catch block.
Yea.. james were in my comuter and i've commented everything that's connected with net (IP, Country and flag) and now it works..

Maybye where / how to fix that?

CODE:
[highlight=vb.net]
'Dim sSource As String = WC.DownloadString(sURL)
'Dim sURL As String = "http://www.ip-adress.com/"


'Private Function GetIP() As String
' Return GetBetween(sSource, "<h2>My IP address is: ", "</h2>")
'End Function

'Private Function GetCountry() As String
' Return GetBetween(sSource, sBracket & " alt=" & sBracket & "ip address flag" & sBracket & " width=" & sBracket & "16" & sBracket & " height=" & sBracket & "11" & sBracket & "> ", "<br>")
'End Function

'Private Function GetFlag() As String
' Return sURL & "flags/" & GetBetween(sSource, "<img src=" & sBracket & "/flags/", sBracket & " alt=" & sBracket & "ip address flag" & sBracket & " width=" & sBracket & "16" & sBracket & " height=" & sBracket & "11" & sBracket & ">")
'End Function


'Label4.Text = GetIP()
'Label2.Text = GetCountry()
'PictureBox1.ImageLocation = GetFlag()
[/highlight]
[highlight=vb.net]
Private Sub doShit()
Dim userPage As String = "http://www.domaintools.com/research/my-ip/myip.xml/"
Dim wc As New WebClient
Dim userInfo As String = wc.DownloadString(userPage)
MsgBox(getCountry(userInfo))
MsgBox(getFlag(userInfo))
wc.Dispose() 'For the sake of Jason
End Sub

Private Function getCountry(ByVal source As String) As String
Return getXMLValue(source, "country")
End Function

Private Function getFlag(ByVal source As String) As String
Return getXMLValue(source, "country_flag")
End Function

Private Function getXMLValue(ByVal source As String, ByVal ID As String)
Try
Dim splitValues() As String = source.Split(New Char() {">"c})
For i As Integer = 0 To splitValues.Length - 1
If splitValues(i).Split(New Char() {"<"})(1) = ID Then Return splitValues(i + 1).Split(New Char() {"<"c})(0)
Next
Catch
End Try
Return Nothing
End Function[/highlight]

Don't troll bout my code, just did it quickly.
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?