I wrote this tool up for the technicians that I work with, they needed a quick way to perform port testing and using command line tools was too “advanced” :-p
Usage is very simple, put in hostname/ip and port number and hit go
TCP port scanning
Threaded to prevent application freezing during blocking calls
Finish code for UDP port scanning, this will be done by starting a listener on local machine and wait for response from remote endpoint. UDP is a stateless protocol which makes it a little bit trickier to detect when a port is actually in a open state
Not too long ago I started writing up my own custom methods using Steam Dota 2 API to obtain match details. My end goal is to calculate who has the best ratio between all of my friends who play this game, so far I’ve written up most the logic and then something crazy happened, I lost all of my code 🙁
No worries! This gives me a chance to share the code as I write it…from the beginning 🙂
I will be programming this in C# using Visual Studio 2012 as my coding environment, I’m going to assume you already know how to create a new project in VS2012 (if not, check out this link)
Ok, now on to the fun part…lets start off by getting just the hero data, such as name/ID/moves.
We will need a couple of things initially that are crucial in order for us to fetch the data:
Create a new project and add a new class, I am calling mine “HeroesClass”.
Heroes Class Code
Now that are class is ready for data, lets start writing up code that will get us to where want to go. What I did is made some global variables for my API key and URL which I could call from anywhere, that way I don’t have to worry too much about always providing input parameters for my methods.
BUT WAIT, ARN’T GLOBAL VARIABLES A BAD IDEA?!?!?! (thanks redditors!)
I think some global variables have there place, in this scenario the API key never changes so I opted to make it global and assign it to variable name API. A bad example of using a global variable would be a match ID, mainly because that changes from match to match and if I was to run a bunch of threads for different matches, it would give me duplicate data depending on what the “matchid” variable was holding during time of thread execution…..
The below method will get a list of all the current heroes and return you an object that you could enumerate through.
I wrote up this tool because I was tired of bringing up CMD prompt and doing an ipconfig /all.The program will loop through all of your active network interfaces and provide you an up to date snapshot of your current settings.
It didn’t take me long to reach my original goal so I decided to add more features to it such as troubleshooting scenarios that involve interface gateway and DNS resolution.
The software also lets you convert a DHCP assigned IP address to static without you having to remember all the settings!
For those interested, this tool queries WMI to gather all of this information. I will soon start posting more code examples and even complete source code.