RE: [Release] Steam Resolver (with a GUI) 03-12-2013, 08:25 AM
#7
1. Not disposing of your WebClient() which you instantiate a new instance of on the heap every call:
Same thing with Steam2(). Although this could become an overloaded method instead of what you're doing there.
2. This couldn't be any more poor, in terms of a validation check...
If you're going to use the Ping class, you should be using the IPStatus return value instead. This is ALSO a class that implements the IDisposable interface, and you're not calling it's Dispose() method here.
3. You've much overused the Try Catch as a method of error handling which is not good at all. That's lazy error handling and bad coding standards.
Code:
Public Function Steam(ByVal SteamID As String) As String
Dim hay As String = New WebClient().DownloadString(("http://tf2-trader.com/bans/index.php?p=banlist&searchText=" & SteamID.Replace(":", "%3A") & "&Submit="))
Return Me.GetExternalIp(hay)
End FunctionSame thing with Steam2(). Although this could become an overloaded method instead of what you're doing there.
2. This couldn't be any more poor, in terms of a validation check...
Code:
Private Sub PictureBox6_Click(ByVal sender As Object, ByVal e As EventArgs)
Try
Dim ping As New Ping
If (ping.Send(Me.TextBox3.Text).RoundtripTime > 1) Then
Me.TextBox3.Text = "IP is alive."
End If
Catch exception1 As Exception
Dim exception As Exception = exception1
Me.TextBox3.Text = "IP is dead."
End Try
End SubIf you're going to use the Ping class, you should be using the IPStatus return value instead. This is ALSO a class that implements the IDisposable interface, and you're not calling it's Dispose() method here.
3. You've much overused the Try Catch as a method of error handling which is not good at all. That's lazy error handling and bad coding standards.
-- cxS
[ Haskell/.NET/C/C++ - Software Engineer ]


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)