11-21-2011, 08:49 PM
Welcome to another tutorial, brought to you by SF Coders. Today I'm going to teach you how to convert a Steam ID into a Profile ID (Similar to this) in Visual Basic .NET - Also easily modified for C# .NET.
Let's begin! First you will need either the persons Steam ID or Friend ID, I'm going to be using my own Friend ID (http://steamcommunity.com/id/TheMilopeach/) Although, as this only works with the original ID of the account, we will need to look into the source code and find the 17 digit version of 'TheMilopeach'.
Open the community page (i.e. http://steam..../TheMilopeach/) and view the source code (As all are basically a modified web page.) and find the string var invitee = " - Make sure it is invitee, not inviter as the inviter is your current account you are using to view the page with and will always be the same.
Now that we have the 17 digit number we can convert it to the Steam ID of that user. (Mine is 76561197960775000).
First - the GUI, Let's start with 2 Labels, 2 Textboxes and a Button. Arrange it like so, or if you have a previous project, throw it in the mix somewhere.
Credits for these functions go to Lake393 from Alliedmods. Thread: http://forums.alliedmods.net/showthread.php?p=784611
Don't forget to Imports System.Text....
The first function will be the GetSteamID function. This will use our 17 digit number to convert to a STEAM_X:X:XXX...
The second will be he GetCommunityID function. This will use our Steam ID and convert it into a community ID.
Once we have that, We'll edit our code to do a little mutation once our button is clicked.
That should do it, Fiddle around with the If statement or make it automatically change and edit when you type in the textbox. There are a few bugs when converting, you must only have 1 textbox with text at any one time.
Hope it helped,
Milopeach.