yucatan Posted July 3, 2008 Share Posted July 3, 2008 hi i have a tcp login but i wanne make a sytem that i can use dieffernt usernames and passwords can i make a .ini with 10 lines\ on eatch line first the username and then the password or something like that any ideas how i can make that the best working with different usernames? Link to comment Share on other sites More sharing options...
yucatan Posted July 3, 2008 Author Share Posted July 3, 2008 hi i have a tcp login but i wanne make a sytem that i can use dieffernt usernames and passwords can i make a .ini with 10 lines\on eatch line first the username and then the password or something like that any ideas how i can make that the best working with different usernames?????? Link to comment Share on other sites More sharing options...
H5O20H Posted July 3, 2008 Share Posted July 3, 2008 (edited) Use iniread and split the received packet from the server in two variables(Username and password).If username is equal to any on the usernames in the ini file and same goes for the second variable. No need to bump every 30 mins. Edited July 3, 2008 by H5O20H Valik, The Legendary programmer!Will be using that signature for 2 months due to my loss on a bet ): Link to comment Share on other sites More sharing options...
yucatan Posted July 3, 2008 Author Share Posted July 3, 2008 Use iniread and split the received packet from the server in two variables(Username and password).If username is equal to any on the usernames in the ini file and same goes for the second variable. No need to bump every 30 mins. i dont fully understand how i need to setup the .ini then can u maby give me a little sample because now you have it like this how define i username and a password in that ? [sectionName] Key=Value Link to comment Share on other sites More sharing options...
H5O20H Posted July 3, 2008 Share Posted July 3, 2008 [sectionName] Account1=Data Password1=Data Account2=Data Password2=Data ... Account10=Data Password10=Data. Valik, The Legendary programmer!Will be using that signature for 2 months due to my loss on a bet ): Link to comment Share on other sites More sharing options...
yucatan Posted July 3, 2008 Author Share Posted July 3, 2008 (edited) [sectionName] Account1=Data Password1=Data Account2=Data Password2=Data ... Account10=Data Password10=Data. how you would read that with ini read because you need to read out the Data .. of the account1 etc.. with ini read you need to search for the username you entered how you would do that ? Edited July 3, 2008 by yucatan Link to comment Share on other sites More sharing options...
H5O20H Posted July 3, 2008 Share Posted July 3, 2008 Well you must setup your client correctly. It's better to use variables like $u=Username and $p=Password So when packet is received use the StringMid function to search for the $u and get the data of the username and password Then you compare the data with the ini file,it's not that hard. Sample "...u=Admin123.&p=NoPass" Valik, The Legendary programmer!Will be using that signature for 2 months due to my loss on a bet ): Link to comment Share on other sites More sharing options...
yucatan Posted July 3, 2008 Author Share Posted July 3, 2008 Well you must setup your client correctly. It's better to use variables like $u=Username and $p=Password So when packet is received use the StringMid function to search for the $u and get the data of the username and password Then you compare the data with the ini file,it's not that hard. Sample "...u=Admin123.&p=NoPass" client expandcollapse popup; Client TCPStartup() $u=InputBox("Username:","Please input your username") $p=InputBox("Password","Please input your password","","*") $socket=TCPConnect("127.0.0.1",2111) If @error Then MsgBox(16,"Error","Couldn't connect to server") Exit EndIf TCPSend($socket,$u&"|"&$p) Do sleep(10) $temp=TCPRecv($socket,256) Until $temp<>"" If $temp="Connected" Then MsgBox(0,"Success","You connected with the right username and pass smile.gif") Else MsgBox(16,"Success","Wrong username / password sad.gif") EndIfoÝ÷ ÚÇ«½êÚºÚ"µÍÈÙ ÝÝ BÔÝ BÌÍÛÝ[HÔÝ[ ][ÝÌLËI][ÝËLLJBÛØ[ ÌÍÝOH ][ÝØYZ[][ÝË ÌÍÜH ][ÝÜÜÝÛÜ ][ÝÂÛØ[ ÌÍÛÙÙÙY[H[ÙBÂÛY L B ÌÍÜÛØÚÙ]HÔXØÙ ÌÍÛÝ[BY ÌÍÜÛØÚÙ] ÉÝÈLH[ÂÛY L B ÌÍÝ[HÔXÝ ÌÍÜÛØÚÙ]MB[[ ÌÍÝ[ ÉÝÈ ][ÝÉ][Ý ÌÍØ^HHÝ[ÔÜ] ÌÍÝ[ ][Ýß ][ÝÊBY ÌÍØ^VÌWHOH ÌÍÝH[ ÌÍØ^VÌHOH ÌÍÜ[ÔÙ[ ÌÍÜÛØÚÙ] ][ÝÐÛÛXÝY ][ÝÊB ÌÍÛÙÙÙY[HYB[ÙBÔÙ[ ÌÍÜÛØÚÙ] ][ÝÐÛÛXÝ[ÛZ[Y ][ÝÊBÔÛÜÙTÛØÚÙ] ÌÍÜÛØÚÙ] B ÌÍÜÛØÚÙ]HLB[Y[Y[[ ÌÍÜÛØÚÙ] ÉÝÈLBÙÐÞ ][ÝÔÝXØÙÜÉ][ÝË ][ÝÔÛÛY[ÛHÛÛXÝYÛZ[KÚY][ÝÊ Link to comment Share on other sites More sharing options...
H5O20H Posted July 3, 2008 Share Posted July 3, 2008 (edited) Until $temp <> "" $array = StringSplit($temp, "|") If $array1 <> "" Then If $Array1 = Iniread(Username1 or username2 or usernam3...) Then If $array2 <> "" Then If $array2 = IniRead(pass1 or pass2 or pass3...) Then Send - "connected" EndIf EndIf EndIf EndIf For security purposes,you can add useless data in the packet(client). $Fakeu=$u+2600 / 1200 ^ 2 $Fakep=$p-$u^2 + 2012 *2 $Fakef=$fakeu+fakepw+12^2 *7312 /20 TCPSend($socket,_StringToHex("1." & $fakeu & "." & $fakef & "." & $fakep)) The server will reverse the calculation and check the values,if they are equal Then - Connected. Just in case you're going to sell your software. Edited July 3, 2008 by H5O20H Valik, The Legendary programmer!Will be using that signature for 2 months due to my loss on a bet ): Link to comment Share on other sites More sharing options...
yucatan Posted July 3, 2008 Author Share Posted July 3, 2008 Until $temp <> "" $array = StringSplit($temp, "|") If $array1 <> "" Then If $Array1 = Iniread(Username1 or username2 or usernam3...) Then If $array2 <> "" Then If $array2 = IniRead(pass1 or pass2 or pass3...) Then Send - "connected" EndIf EndIf EndIf EndIf For security purposes,you can add useless data in the packet(client). $Fakeu=$u+2600 / 1200 ^ 2 $Fakep=$p-$u^2 + 2012 *2 $Fakef=$fakeu+fakepw+12^2 *7312 /20 TCPSend($socket,_StringToHex("1." & $fakeu & "." & $fakef & "." & $fakep)) The server will reverse the calculation and check the values,if they are equal Then - Connected. Just in case you're going to sell your software. $var = IniRead("C:\Temp\users.ini", "users", "yucatan", "Not Found.") why this code dont work. this is my users.ini [users] user=password Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now