Here is the source:
Function1 (Steam To Community):
void SteamToCommunity(string authServer, string mainId, Int64 aus, Int64 mid)
{
try
{
if (tbSID1.Text != String.Empty)
{
Int64 b = 76561197960265728;
Int64 b2 = b + aus;
Int64 mid2 = mid * 2;
Int64 final = b2 + mid2;
tbCOM1.Text = "http://steamcommunity.com/profiles/" + final.ToString();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Function2 (Community to Steam):
void CommunityToSteam(Int64 communityId, int authServer)
{
try
{
if (tbprofile.Text != String.Empty)
{
Int64 p1 = communityId - 76561197960265728 - authServer;
Int64 p2 = p1 / 2;
string final = "STEAM0:" + authServer.ToString() + ":" + p2.ToString();
tb_ID2.Text = final;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
The rest is just textboxes and buttons, use:
SteamToCommunity(string authServer, string mainId, Int64 aus, Int64 mid)
and
CommunityToSteam(Int64 communityId, int authServer)
The additional stuff is checking if the numbers are even when converting community pages to steamids.
private void b_Convert1_Click(object sender, EventArgs e)
{
try
{
String authServer = tb_SID1.Text.Substring(8, 1);
String mainId = tb_SID1.Text.Substring(10);
SteamToCommunity(tb_SID1.Text.Substring(8, 1), tb_SID1.Text.Substring(10), Int64.Parse(authServer), Int64.Parse(mainId));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void bConvert2Click(object sender, EventArgs e)
{
try
{
Int64 communityId = Int64.Parse(tbprofile.Text);
string sub1 = tbprofile.Text.Substring(tb_profile.Text.Length - 1);
int sub11 = int.Parse(sub1);
if (sub11.Equals(0) || sub11.Equals(2) || sub11.Equals(4) || sub11.Equals(6) || sub11.Equals(8))
{
int authServer = 0;
CommunityToSteam(communityId, authServer);
}
else
{
int authServer = 1;
CommunityToSteam(communityId, authServer);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message,"Error!",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
Thats it.
Fat Monster